Timezone definition has disappeared for 'Europe/Copenhagen'

Bug #94415 reported by peterdv
8
Affects Status Importance Assigned to Milestone
python-tz (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: python-tz

Timezone definition has recently disappeared for 'Europe/Copenhagen', this may be related to Bug #41159 - so perhaps this bug should have been filed on tzdata ?

>>> import pytz
>>> pytz.all_timezones.index('Europe/Copenhagen')
399
>>> pytz.timezone('Europe/Copenhagen')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/pytz/__init__.py", line 93, in timezone
    _tzinfo_cache[zone] = build_tzinfo(zone, open_resource(zone))
  File "/usr/lib/python2.5/site-packages/pytz/__init__.py", line 41, in open_resource
    return resource_stream(__name__, 'zoneinfo/' + name)
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 806, in resource_stream
    self, resource_name
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1162, in get_resource_stream
    return open(self._fn(self.module_path, resource_name), 'rb')
IOError: [Errno 2] No such file or directory: '/usr/lib/python2.5/site-packages/pytz/zoneinfo/Europe/Copenhagen'
>>>

Revision history for this message
peterdv (peter-dahl-vestergaard) wrote :

Sorry, I forgot to tell:
ii python-tz 2007c-0ubuntu1 Python version of the Olson timezone databas
ii tzdata 2007b-0ubuntu1 Time Zone and Daylight Saving Time Data

tzdata appears to be the newest awailable (https://launchpad.net/ubuntu/+source/tzdata):
2007-02-15 23:03:14 UTC Published feisty Release main libs 2007b-0ubuntu1

Revision history for this message
peterdv (peter-dahl-vestergaard) wrote :

Crude, irresponsible workaround:

sudo mv /usr/lib/python2.5/site-packages/pytz/zoneinfo /usr/lib/python2.5/site-packages/pytz/zoneinfo.orig
sudo ln -s /usr/share/zoneinfo /usr/lib/python2.5/site-packages/pytz/zoneinfo

results in the expected response:

Python 2.5 (release25-maint, Mar 15 2007, 10:53:31)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pytz
>>> pytz.all_timezones.index('Europe/Copenhagen')
399
>>> pytz.timezone('Europe/Copenhagen')
<DstTzInfo 'Europe/Copenhagen' CET+1:00:00 STD>
>>>

Revision history for this message
Marius Gedminas (mgedmin) wrote :

This affects all timezones, not just Europe/Copenhagen. pytz doesn't know it's now supposed to look in /usr/share/zoneinfo and instead tries to look inside /usr/lib/python2.{4,5}/site-packages/pytz/zoneinfo, which is an empty directory.

Revision history for this message
Sebastien Bacher (seb128) wrote :

fixed with the new version in gutsy

Changed in python-tz:
importance: Undecided → Low
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.