[Reportbug-maint] Bug#524297: Bug#524297: `reportbug --configure' tries to decode u''
chaica at ohmytux.com
chaica at ohmytux.com
Thu Apr 16 22:37:13 UTC 2009
tags 524297 patch
stop
Hi,
Here is a patch to solve the issue.
Regards,
Carl Chenet
On Wed, 15 Apr 2009 23:55:10 -0400, James Vega <jamessan at debian.org> wrote:
> Package: reportbug
> Version: 4.1
> Severity: normal
>
> Traceback (most recent call last):
> File "/usr/bin/reportbug", line 1831, in <module>
> main()
> File "/usr/bin/reportbug", line 848, in main
> return iface.user_interface()
> File "/usr/bin/reportbug", line 870, in user_interface
> offer_configuration(self.options)
> File "/usr/bin/reportbug", line 470, in offer_configuration
> default=(options.email or def_email), force_prompt=True)
> File "/usr/lib/pymodules/python2.5/reportbug/ui/text_ui.py", line 246,
in
> get_string
> response = unicode(response, charset, 'replace')
> TypeError: decoding Unicode is not supported
>
> This is happening because the unicode object that utils.get_email()
returns
> in
> offer_configuration() isn't decoded before being passed as the default
> kwarg
> to get_string(). decoding first (like is done for def_realname) or
> changing
> get_string() to check whether response is already unicode should fix the
> problem.
>
> Currently, this prevents reportbug from ever writing out the initial
config
> on
> my system.
>
> -- Package-specific info:
> ** Environment settings:
> DEBEMAIL="jamessan at debian.org"
> DEBFULLNAME="James Vega"
>
> -- System Information:
> Debian Release: squeeze/sid
> APT prefers unstable
> APT policy: (500, 'unstable'), (100, 'experimental')
> Architecture: i386 (i686)
>
> Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/bash
>
> Versions of packages reportbug depends on:
> ii apt 0.7.20.2 Advanced front-end for dpkg
> ii python 2.5.4-2 An interactive high-level
> object-o
> ii python-reportbug 4.1 Python modules for
interacting
> wit
>
> reportbug recommends no packages.
>
> Versions of packages reportbug suggests:
> pn debconf-utils <none> (no description available)
> pn debsums <none> (no description available)
> pn dlocate <none> (no description available)
> ii file 5.00-1 Determines file type using
> "magic"
> ii gnupg 1.4.9-4 GNU privacy guard - a free
PGP
> rep
> ii postfix [mail-transport-agent 2.5.5-1.1 High-performance mail
> transport ag
> pn python-gnome2-extras <none> (no description available)
> ii python-gtk2 2.14.1-2 Python bindings for the GTK+
> widge
> pn python-urwid <none> (no description available)
> pn python-vte <none> (no description available)
>
> -- no debconf information
>
>
>
> _______________________________________________
> Reportbug-maint mailing list
> Reportbug-maint at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/reportbug-maint
-------------- next part --------------
From 12580a96bcaca29d5a0cc02133dd9b82c3056a52 Mon Sep 17 00:00:00 2001
From: carl <carl at bureau-carl.(none)>
Date: Thu, 16 Apr 2009 16:57:15 +0200
Subject: [PATCH] Decode def_email
---
bin/reportbug | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/bin/reportbug b/bin/reportbug
index 47fc7d7..9d6a7cf 100755
--- a/bin/reportbug
+++ b/bin/reportbug
@@ -455,6 +455,11 @@ def offer_configuration(options):
def_realname, def_email = utils.get_email()
try:
+ def_email = def_email.encode(charset, 'replace')
+ except UnicodeDecodeError:
+ def_email = ''
+
+ try:
if options.realname:
realname = options.realname.encode(charset, 'replace')
else:
--
1.5.6.3
More information about the Reportbug-maint
mailing list