Package: python3
Version: 3.5.1-2
Severity: important
Control: block 796061 by -1 


Hi

apt-listchanges contains code like:
  sys.stdout.write(_("Reading changelogs") + "...\n")

In pl_PL.UTF-8 locale the python3 version of apt-listchanges (from bug#796061) 
such a line causes the program to fail with
 TypeError: can't concat bytes to str
Surprisingly the no error is returned when locale is C.

In my opinion this is a serious mis-design of gettext.lgettext() which
prevents me from performing the migration of apt-listchanges to python3.

See also the following typescript:

/home/robert> python3
Python 3.5.1+ (default, Mar 18 2016, 15:12:19)
[GCC 5.3.1 20160307] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gettext
>>> import os
>>> import locale
>>> print (locale.getdefaultlocale())
('pl_PL', 'UTF-8')
>>> gettext.textdomain('apt-listchanges')
'apt-listchanges'
>>> gettext.lgettext("Informational notes")
b'Dodatkowe informacje'
>>> gettext.lgettext("Informational notes") + "\n"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can't concat bytes to str
>>> gettext.lgettext("Unknown message") + "\n"
'Unknown message\n'
>>> os.environ['LC_ALL'] = 'C'
>>> print (locale.getdefaultlocale())
(None, None)
>>> gettext.lgettext("Informational notes") + "\n"
'Informational notes\n'


Regards,
robert


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (200, 'testing')
Architecture: i386 (i686)

Kernel: Linux 4.4.0-1-686-pae (SMP w/1 CPU core)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages python3 depends on:
ii  dh-python          2.20151103
ii  libpython3-stdlib  3.5.1-2
ii  python3-minimal    3.5.1-2
ii  python3.5          3.5.1-8

python3 recommends no packages.

Versions of packages python3 suggests:
pn  python3-doc   <none>
pn  python3-tk    <none>
pn  python3-venv  <none>

-- no debconf information

Reply via email to