← Back to team overview

touch-packages team mailing list archive

[Bug 1501456] Re: pytz.country_names UnicodeDecodeError exception

 

*** This bug is a duplicate of bug 1473533 ***
    https://bugs.launchpad.net/bugs/1473533

drat, wrong bug.   I meant to put that in bug #1473533

** No longer affects: tzdata (Ubuntu)

** This bug has been marked a duplicate of bug 1473533
   CountryNameDict function trying to parse UTF-8 iso3166.tab as US-ASCII

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to tzdata in Ubuntu.
https://bugs.launchpad.net/bugs/1501456

Title:
  pytz.country_names UnicodeDecodeError exception

Status in python-tz package in Ubuntu:
  Confirmed

Bug description:
  Wily:
  # python3 -c 'from pytz import country_names
  for item in country_names.items():
    print(item)'
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "/usr/lib/python3.4/_collections_abc.py", line 497, in __iter__
      for key in self._mapping:
    File "/usr/lib/python3/dist-packages/pytz/lazy.py", line 41, in __iter__
      self._fill()
    File "/usr/lib/python3/dist-packages/pytz/__init__.py", line 350, in _fill
      line = line.decode('US-ASCII')
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)

  # python -c 'from pytz import country_names
  print(country_names)'
  Traceback (most recent call last):
    File "<string>", line 2, 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/lazy.py", line 41, in __iter__
      self._fill()
    File "/usr/lib/python2.7/dist-packages/pytz/__init__.py", line 350, in _fill
      line = line.decode('US-ASCII')
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)

  # dpkg-query -l python-tz python3-tz tzdata
  Desired=Unknown/Install/Remove/Purge/Hold
  | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
  |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
  ||/ Name           Version      Architecture Description
  +++-==============-============-============-=================================
  ii  python-tz      2014.10~dfsg all          Python version of the Olson timez
  ii  python3-tz     2014.10~dfsg all          Python3 version of the Olson time
  ii  tzdata         2015f-1      all          time zone and daylight-saving tim

  
  Also affect trusty and vivid in the same way.  Testing on trusty shows that this broke with the release of tzdata=2015f-0ubuntu0.14.04, prior to that tzdata version country_names could parse the data.  debdiff shows that tzdata=2015f-0ubuntu0.14.04 changes this file, and others to utf-8 from ascii.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-tz/+bug/1501456/+subscriptions


References