Bug#792192: python-tz: pytz.country_names fails to initialise with UnicodeDecodeError: 'ascii' .. from iso3166.tab

Chris West (Faux) solo-debianbugs at goeswhere.com
Sun Jul 12 14:00:25 UTC 2015


Source: python-tz
Version: 2012c+dfsg-0.1
Severity: normal

Dear Maintainer,

The package can't load modern versions of tzdata: /usr/share/zoneinfo/iso3166.tab
explicitly explains that it's UTF-8, but the package assumes it's US-ASCII:

$ python
Python 2.7.10 (default, Jul  1 2015, 10:54:53) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pytz; pytz.country_names
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/UserDict.py", line 172, in __repr__
    return repr(dict(self.iteritems()))
  File "/usr/lib/python2.7/UserDict.py", line 110, in iteritems
    for k in self:
  File "/usr/lib/python2.7/dist-packages/pytz/__init__.py", line 300, in __iter__
    self._fill()
  File "/usr/lib/python2.7/dist-packages/pytz/__init__.py", line 383, in _fill
    line = line.decode('US-ASCII')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)

This breaks the build of wader 0.5.12.

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.19.0-22-generic (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)



More information about the pkg-zope-developers mailing list