Bugs item #1447945, was opened at 2006-03-11 13:51 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1447945&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Ilpo Nyyssönen (biny) Assigned to: Nobody/Anonymous (nobody) Summary: Unable to stringify datetime with tzinfo Initial Comment: zdump -v Europe/Helsinki | head -5 gives Europe/Helsinki Fri Dec 13 20:45:52 1901 UTC = Fri Dec 13 22:25:44 1901 EET isdst=0 gmtoff=5992 Europe/Helsinki Sat Dec 14 20:45:52 1901 UTC = Sat Dec 14 22:25:44 1901 EET isdst=0 gmtoff=5992 Europe/Helsinki Sat Apr 30 22:20:07 1921 UTC = Sat Apr 30 23:59:59 1921 EET isdst=0 gmtoff=5992 Europe/Helsinki Sat Apr 30 22:20:08 1921 UTC = Sun May 1 00:20:08 1921 EET isdst=0 gmtoff=7200 Europe/Helsinki Thu Apr 2 21:59:59 1942 UTC = Thu Apr 2 23:59:59 1942 EET isdst=0 gmtoff=7200 Europe/Helsinki Thu Apr 2 22:00:00 1942 UTC = Fri Apr 3 01:00:00 1942 EEST isdst=1 gmtoff=10800 Python 2.4.1 (#1, May 16 2005, 15:19:29) [GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. ->> from datetime import datetime ->> from dateutil import tz ->> str(datetime(1920, 1, 1, 0, 0, tzinfo=tz.gettz('Europe/Helsinki'))) Traceback (most recent call last): File "<input>", line 2, in ? ValueError: tzinfo.utcoffset() must return a whole number of minutes ->> tz.gettz('Europe/Helsinki').utcoffset((datetime(1900, 1, 1, 0, 0))) datetime.timedelta(0, 5992) ->> ---------------------------------------------------------------------- >Comment By: Tim Peters (tim_one) Date: 2006-03-11 15:38 Message: Logged In: YES user_id=31435 I don't know that this needs "a solution", but doubt anything relevant is going to change in Python regardless -- that utcoffset() must return a whole number of minutes has been documented from the start, and in several years hasn't caused anyone else a problem. Do you really believe that Helsinki was once 99 minutes and 52 seconds off from UTC? I don't ;-) Seems more likely that your installation's time zone info is corrupt; that this specific piece of historical time zone info is wrong but nobody noticed before ("historical" because it's certainly not the case that Helsinki is ever 5992 seconds off from UTC in current reality); or that `dateutil` has a relevant error. ---------------------------------------------------------------------- Comment By: Ilpo Nyyssönen (biny) Date: 2006-03-11 14:12 Message: Logged In: YES user_id=861953 What do you think is best solution? 1) Python datetime is changed to tolerate more. 2) Linux tzdata package is changed to contain only full minute offsets. Who is going to convince them that this is good idea? 3) The python-dateutil tz library is changed to touch the information provided by the operating system. ---------------------------------------------------------------------- Comment By: Ilpo Nyyssönen (biny) Date: 2006-03-11 14:06 Message: Logged In: YES user_id=861953 The error is from datetime and it is from python distribution. The tz uses operating systems information about the timezones and as the zdump shows, it gets there utcoffset that is not full minute. ---------------------------------------------------------------------- Comment By: Tim Peters (tim_one) Date: 2006-03-11 13:58 Message: Logged In: YES user_id=31435 What's this? >>> from dateutil import tz There is no `dateutil` module in the Python distribution (in which case problems with `dateutil` should be directed to its developers, not to the Python tracker). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1447945&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com