Package: python-tz Version: svn 2074 The file tzfile.py is intended to be executable directly, which runs some test cases by opening up the zoneinfo files. The Debian package version of python-tz has the __init__.py file modified to use the standard Debian zoneinfo files rather than the ones included with pytz. This testing code, however, still tries to look that up in the pytz local directory, and fails.
Attached is a patch (against the Subversion repository at svn://svn.debian.org/svn/pkg-zope/python-tz/trunk) which fixes the testing code to use the Debian zoneinfo files.
Index: tzdata =================================================================== --- tzdata (revision 2074) +++ tzdata (working copy) @@ -20,3 +20,21 @@ return open(filename, 'rb') +--- pytz-2010b/pytz/tzfile.py 2010-01-26 18:10:01.000000000 +1100 ++++ ../trunk/pytz/tzfile.py 2010-04-30 10:46:15.000000000 +1000 +@@ -113,10 +113,14 @@ + import os.path + from pprint import pprint + base = os.path.join(os.path.dirname(__file__), 'zoneinfo') ++ # Patched in Debian, use the system zoninfo from the tzdata package + tz = build_tzinfo('Australia/Melbourne', +- open(os.path.join(base,'Australia','Melbourne'), 'rb')) ++ open(os.path.join('/usr/share/zoneinfo', ++ 'Australia','Melbourne'), 'rb')) + tz = build_tzinfo('US/Eastern', +- open(os.path.join(base,'US','Eastern'), 'rb')) ++ open(os.path.join('/usr/share/zoneinfo', ++ 'US','Eastern'), 'rb')) + pprint(tz._utc_transition_times) + #print tz.asPython(4) + #print tz.transitions_mapping