Author vstinner
Recipients David.Edelsohn, python-dev, serhiy.storchaka, vstinner
Date 2014-02-21.15:33:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1392996820.73.0.150077780531.issue19748@psf.upfronthosting.co.za>
In-reply-to
Content
"""
WITHOUT the patch to timemodule.c:

>>> time.ctime(-2**29)
'Fri Dec 26 21:11:28 1952'
"""

Oh, in this case, pylocaltime_aix.patch is wrong. There was a bug in mktime(), but ctime() works fine.

"""
  File "/home/dje/src/cpython/Lib/test/test_time.py", line 354, in test_mktime
    self.assertEqual(time.mktime(tt), t)
OverflowError: mktime argument out of range
"""

Oh, I don't understand this one. On Linux I get:

>>> time.localtime(-2)
time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=59, tm_sec=58, tm_wday=3, tm_yday=1, tm_isdst=0)
>>> time.localtime(-1)
time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=59, tm_sec=59, tm_wday=3, tm_yday=1, tm_isdst=0)
>>> time.localtime(0)
time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=1, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)
>>> time.localtime(1)
time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=1, tm_min=0, tm_sec=1, tm_wday=3, tm_yday=1, tm_isdst=0)

And:

>>> time.mktime(time.localtime(-2)) 
-2.0
>>> time.mktime(time.localtime(-1)) 
-1.0
>>> time.mktime(time.localtime(0)) 
0.0
>>> time.mktime(time.localtime(1)) 
1.0
History
Date User Action Args
2014-02-21 15:33:40vstinnersetrecipients: + vstinner, python-dev, serhiy.storchaka, David.Edelsohn
2014-02-21 15:33:40vstinnersetmessageid: <1392996820.73.0.150077780531.issue19748@psf.upfronthosting.co.za>
2014-02-21 15:33:40vstinnerlinkissue19748 messages
2014-02-21 15:33:40vstinnercreate