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.
Created on 2014年07月25日 15:05 by serhiy.storchaka, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg223955 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2014年07月25日 15:05 | |
time_test fails when running after any test which uses strptime(). The bug can be easily reproduced by running test_time twice: $ TZ=Europe/Kiev ./python -m test.regrtest -ugui -v test_time test_time ... ====================================================================== FAIL: test_strptime (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/serhiy/py/cpython-2.7/Lib/test/test_time.py", line 120, in test_strptime (format, strf_output)) AssertionError: conversion specifier '%Z' failed with 'MSK' input. ---------------------------------------------------------------------- All works on 3.x and with TZ=UTC. May be this is related to issue13309. |
|||
| msg255842 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2015年12月03日 21:40 | |
If call time.localtime() with time before 1990年03月25日T03:00, EET is turned to MSK. I guess this is a time when the Europe/Kiev timezone was introduced.
>>> import os, time
>>> os.environ['TZ'] = 'Europe/Kiev'
>>> time.tzset()
>>> time.localtime(638319599)
time.struct_time(tm_year=1990, tm_mon=3, tm_mday=25, tm_hour=1, tm_min=59, tm_sec=59, tm_wday=6, tm_yday=84, tm_isdst=0)
>>> time.strftime('%Z', time.gmtime())
'MSK'
>>> time.localtime(638319600)
time.struct_time(tm_year=1990, tm_mon=3, tm_mday=25, tm_hour=3, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=84, tm_isdst=1)
>>> time.strftime('%Z', time.gmtime())
'EET'
C function localtime() implicitly calls tzset() and sets global C variables tzname, timezone, and daylight, but these changes are not exposed as variables in the time module. C and Python ideas about timezone becomes different. This looks as a bug in time.localtime() and other functions that implicitly change timezone variables.
|
|||
| msg406806 - (view) | Author: Irit Katriel (iritkatriel) * (Python committer) | Date: 2021年11月22日 22:20 | |
I am unable to reproduce this on 3.11. |
|||
| msg406825 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2021年11月23日 08:28 | |
Yes, it was 2.7-only issue. Thank you Irit for checking and closing outdated issues. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:06 | admin | set | github: 66265 |
| 2021年11月23日 08:28:45 | serhiy.storchaka | set | status: pending -> closed resolution: works for me -> out of date messages: + msg406825 stage: resolved |
| 2021年11月22日 22:20:36 | iritkatriel | set | status: open -> pending nosy: + iritkatriel messages: + msg406806 resolution: works for me |
| 2015年12月03日 21:40:04 | serhiy.storchaka | set | messages: + msg255842 |
| 2014年11月17日 12:41:35 | serhiy.storchaka | set | nosy:
+ belopolsky, pitrou |
| 2014年07月25日 15:05:06 | serhiy.storchaka | create | |