This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author veebers
Recipients barry, belopolsky, lemburg, pitrou, thomir, veebers
Date 2014-10-14.20:13:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1413317601.57.0.944340108984.issue22627@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Antoine, thanks for taking a look.

I should explain further. This code is for an introspection tool[1] that provides an interface to write tests in python against an application.

This code is a workaround for using large timestamps[2] (i.e. larger than 32bit time_t) the original suggested code (from SO, using timedelta) has an inconsistancy with the hour in some cases (this example in the NZ timezone):
>>> datetime.datetime.fromtimestamp(2047570047)
datetime.datetime(2034, 11, 19, 17, 27, 27)

>>> datetime.datetime.fromtimestamp(0) + datetime.timedelta(seconds=2047570047)
datetime.datetime(2034, 11, 19, 18, 27, 27)

The code you see here in my example, creating a timezone aware object, is a result of 'fixing' this behaviour I've seen.
The reason for then removing the tzinfo is because currently our API states that dates returned from the introspected objects are naive.


[1] https://launchpad.net/autopilot
[2] https://bugs.launchpad.net/autopilot/+bug/1328600
History
Date User Action Args
2014-10-14 20:13:21veeberssetrecipients: + veebers, lemburg, barry, belopolsky, pitrou, thomir
2014-10-14 20:13:21veeberssetmessageid: <1413317601.57.0.944340108984.issue22627@psf.upfronthosting.co.za>
2014-10-14 20:13:21veeberslinkissue22627 messages
2014-10-14 20:13:21veeberscreate