[issue14902] test_logging failed

Vinay Sajip report at bugs.python.org
Tue Jul 3 19:16:59 CEST 2012


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

Yes, thanks for doing the detailed analysis. I see that the original code was trying to adjust the timezone for a past time effectively using current timezone rules, which is why it doesn't work.

Your patch appears equivalent to the slightly simpler

dt = datetime.datetime(1993, 4, 21, 8, 3, 0, 0, utc)
r.created = time.mktime(dt.astimezone(None).timetuple())

which echoes the intent of the original code to adjust for the timezone. Can you see any reason why the above shouldn't work? On my test machine, it worked fine with the above code and locations of Moscow, London and Caracas (the original code failed with Caracas, though not with Moscow - but do I understand that the original is broken).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14902>
_______________________________________


More information about the Python-bugs-list mailing list