Bug#739507: UnicodeEncodeError: 'ascii' codec can't encode character

2015-04-24 Thread Sandro Tosi
Hi,

On Sat, Apr 18, 2015 at 9:33 AM, Bernhard Übelacker bernha...@vr-web.de wrote:
 - add to /usr/bin/reportbug after the import sys these 2 lines:
 reload(sys)
 sys.setdefaultencoding(utf-8)

yup, I agree this is the most direct and effective way to fix all
those bugs about enconding, so I'll go this way.

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#739507: UnicodeEncodeError: 'ascii' codec can't encode character

2015-04-18 Thread Bernhard Übelacker
Package: reportbug
Version: 6.6.3
Followup-For: Bug #739507

Dear Maintainer,
this issue manifested on a fresh Jessie installation and
therefore I tried to find out something about it.

To me it looks like on affected systems no one sets the
default encoding in this python process.
At least my system where it does not appear it is set.

Therefore I collected now 2 workarounds:
- install package python-gtk2 (which sets default encoding on initialization,
initpango () from /usr/lib/python2.7/dist-packages/gtk-2.0/pango.so)
- add to /usr/bin/reportbug after the import sys these 2 lines:
reload(sys)
sys.setdefaultencoding(utf-8)

Kind regards,
Bernhard

(Attached some lines about the debugging.)



-- Package-specific info:
** Environment settings:
INTERFACE=text

** /home/benutzer/.reportbugrc:
reportbug_version 6.6.3
mode standard
ui text
realname Bernhard Übelacker
email bernha...@vr-web.de
no-cc
header X-Debbugs-CC: bernha...@vr-web.de
smtphost reportbug.debian.org

-- System Information:
Debian Release: 8.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages reportbug depends on:
ii  apt   1.0.9.7
ii  python2.7.9-1
ii  python-reportbug  6.6.3
pn  python:anynone

reportbug recommends no packages.

Versions of packages reportbug suggests:
pn  claws-mail none
pn  debconf-utils  none
pn  debsumsnone
pn  dlocatenone
pn  emacs23-bin-common | emacs24-bin-commonnone
ii  exim4  4.84-8
ii  exim4-daemon-light [mail-transport-agent]  4.84-8
ii  file   1:5.22+15-2
ii  gnupg  1.4.18-7
pn  python-gtk2none
pn  python-gtkspellnone
pn  python-urwid   none
pn  python-vte none
pn  xdg-utils  none

Versions of packages python-reportbug depends on:
ii  apt   1.0.9.7
ii  python-debian 0.1.25
ii  python-debianbts  1.12
pn  python:anynone

python-reportbug suggests no packages.

-- no debconf information

apt-get source python2.7
cd python2.7-2.7.9/Objects

gdb --args /usr/bin/python pdb /usr/bin/reportbug
(gdb) run
(Pdb) b /usr/bin/reportbug:578
(Pdb) cont
# answer the questions, enter a realname with non-ascii character
 /usr/bin/reportbug(578)offer_configuration()
- realname = realname.decode(charset, 'replace')
(Pdb) 
# CTRL+c
(gdb) b PyUnicodeEncodeError_Create
(gdb) cont
cont
Breakpoint 1, PyUnicodeEncodeError_Create (encoding=0x60a268 ascii, 
object=0x73e5bad0, length=18, start=9, end=10, reason=0x625c9c ordinal not 
in range(128)) at ../Objects/exceptions.c:1713
1713{
(gdb) bt
#0  PyUnicodeEncodeError_Create (encoding=0x60a268 ascii, 
object=0x73e5bad0, length=18, start=9, end=10, reason=0x625c9c ordinal not 
in range(128)) at ../Objects/exceptions.c:1713
#1  0x00554709 in make_encode_exception () at 
../Objects/unicodeobject.c:3522
#2  0x005554fe in raise_encode_exception.lto_priv () at 
../Objects/unicodeobject.c:3545
#3  0x005523cc in unicode_encode_ucs1.lto_priv () at 
../Objects/unicodeobject.c:3677
#4  0x0058da8d in _PyUnicodeUCS4_AsDefaultEncodedString 
(unicode=unicode@entry=u'Bernhard \xdcbelacker', errors=errors@entry=0x0) at 
../Objects/unicodeobject.c:1391
#5  0x004b5fd0 in convertsimple.lto_priv () at ../Python/getargs.c:843
#6  0x004c03de in convertitem (freelist=optimized out, 
bufsize=optimized out, msgbuf=optimized out, levels=optimized out, 
flags=optimized out, p_va=optimized out, p_format=optimized out, 
arg=optimized out) at ../Python/getargs.c:514
#7  vgetargs1.lto_priv () at ../Python/getargs.c:345
#8  0x004e31e9 in _PyArg_ParseTuple_SizeT (args=optimized out, 
format=format@entry=0x62c91b s*|zi:utf_8_decode) at ../Python/getargs.c:97
#9  0x00589f29 in utf_8_decode.lto_priv () at 
../Modules/_codecsmodule.c:265
#10 0x004cd9ca in call_function (oparg=optimized out, 
pp_stack=optimized out) at ../Python/ceval.c:4033
#11 PyEval_EvalFrameEx () at ../Python/ceval.c:2679
#12 0x004e5fe8 in PyEval_EvalCodeEx (closure=optimized out, 
defcount=optimized out, defs=optimized out, kwcount=optimized out, 
kws=optimized out, argcount=optimized out, args=optimized out, 
locals=optimized out, g

#59 0x00497ca0 in _start ()



The first difference between working and not working was in 
../Objects/unicodeobject.c:1355
1355if (strcmp(encoding, utf-8) == 0)

After looking where default 

Bug#739507: UnicodeEncodeError: 'ascii' codec can't encode character

2014-02-19 Thread LaNaar Dakoté
Package: reportbug
Version: 6.5.0

When I invoke `reportbug --configure` and I have to configure a real
name, reportbug prints the following output and quit right after that:

 What real name should be used for sending bug reports?
 [naar] LaNaar Dakoté
   Traceback (most recent call last):
   File /usr/bin/reportbug, line 2209, in module
 main()
   File /usr/bin/reportbug, line 1079, in main
 return iface.user_interface()
   File /usr/bin/reportbug, line 1101, in user_interface
 offer_configuration(self.options)
   File /usr/bin/reportbug, line 576, in offer_configuration
 realname = realname.decode(charset, 'replace')
   File /usr/lib/python2.7/encodings/utf_8.py, line 16, in decode
 return codecs.utf_8_decode(input, errors, True)
  UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 12: ordinal not in range(128)


---
-- Package-specific info:

-- System Information:
Debian Release: 7.4
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'stable-updates'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-4-686-pae (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages reportbug depends on:
ii  apt   0.9.7.9+deb7u1
ii  python2.7.5-5
ii  python-reportbug  6.5.0

reportbug recommends no packages.

Versions of packages reportbug suggests:
pn  claws-mail none
pn  debconf-utils  none
pn  debsumsnone
pn  dlocatenone
pn  emacs22-bin-common | emacs23-bin-commonnone
ii  exim4  4.80-7
ii  exim4-daemon-light [mail-transport-agent]  4.80-7
ii  file   5.11-2+deb7u1
ii  gnupg  1.4.12-7+deb7u3
pn  python-gtk2none
pn  python-gtkspellnone
pn  python-urwid   none
pn  python-vte none
pn  xdg-utils  none

Versions of packages python-reportbug depends on:
ii  apt   0.9.7.9+deb7u1
ii  python2.7.5-5
ii  python-debian 0.1.21
ii  python-debianbts  1.11
ii  python-support1.0.15

python-reportbug suggests no packages.

-- no debconf information



signature.asc
Description: OpenPGP digital signature