Message317190
I was able to reproduce this issue on Linux as follows
>>> import time, calendar, os
>>> os.environ['TZ'] = 'right/UTC' # "right" timezones account for leap seconds
>>> time.tzset()
>>> calendar.timegm(time.gmtime(1234567899))
1234567875
This confirms Martin's insight that on the OP's system gmtime accounts for leap seconds.
There has been a general trend in Python to replace calls to system dependent functions in the time module with system independent reimplementations. It is certainly possible to reimplement time.gmtime, but someone should champion this idea on python-dev. |
|
Date |
User |
Action |
Args |
2018-05-20 16:57:49 | belopolsky | set | recipients:
+ belopolsky, tim.peters, martin.panter, eitan.adler |
2018-05-20 16:57:49 | belopolsky | set | messageid: <1526835469.75.0.682650639539.issue33579@psf.upfronthosting.co.za> |
2018-05-20 16:57:49 | belopolsky | link | issue33579 messages |
2018-05-20 16:57:49 | belopolsky | create | |
|