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 martin.panter
Recipients belopolsky, martin.panter, python-dev, serhiy.storchaka, vstinner
Date 2015-11-14.13:34:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1447508074.66.0.525534025508.issue25168@psf.upfronthosting.co.za>
In-reply-to
Content
Info when the s390x SLES 3.x buildbot failed <http://buildbot.python.org/all/builders/s390x%20SLES%203.x/builds/414/steps/test/logs/stdio>:

_TimeRE_cache['Z']='(?P<Z>std|utc|gmt|dst)'
TZ=None, or None via getenv()
_regex_cache={'%Y-%m-%d %H:%M:%S.%f': re.compile('(?P<Y>\\d\\d\\d\\d)-(?P<m>1[0-2]|0[1-9]|[1-9])-(?P<d>3[0-1]|[1-2]\\d|0[1-9]|[1-9]| [1-9])\\s+(?P<H>2[0-3]|[0-1]\\d|\\d):(?P<M>[0-5]\\d|\\d):(?P<S>6[0-1]|[0-5]\\d|\\d)\\.(?P<f>[0-9]{1,6})', re.IGNORECASE), '%Z': re.compile('(?P<Z>std|utc|gmt|dst)', re.IGNORECASE), '%z %Z': re.compile('(?P<z>[+-]\\d\\d[0-5]\\d)\\s+(?P<Z>std|utc|gmt|dst)', re.IGNORECASE), '%z': re.compile('(?P<z>[+-]\\d\\d[0-5]\\d)', re.IGNORECASE)}

So it seems _TimeRE_cache has been initialized when time.tzname = ("STD", "DST"), and this agrees with the contents of _regex_cache. When the tests fail, there is no TZ environment variable set, but the test is trying to use the time zone “EST”, which apparently comes from time.tzname[0]. The question in my mind is why did tzname change from when _strptime was initialized to when the tests ran?

Keys in _regex_cache, showing what has been parsed since it was cleared:

'%Y-%m-%d %H:%M:%S.%f'
'%Z'
'%z %Z'
'%z'

test_strptime() is inherited by various classes. The first version passed, and the other five failed:

test_strptime (test.datetimetester.TestDateTime) ... ok
test_strptime (test.datetimetester.TestSubclassDateTime) ... FAIL
test_strptime (test.datetimetester.TestDateTimeTZ) ... FAIL
test_strptime (test.datetimetester.TestDateTime) ... FAIL
test_strptime (test.datetimetester.TestSubclassDateTime) ... FAIL
test_strptime (test.datetimetester.TestDateTimeTZ) ... FAIL

Inbetween the good and the first bad test_strptime() runs, there are the remaining TestDateTime tests, then the TestDateOnly, TestTZInfo, TestTimeZone, TestTimeTZ, TestDate, TestTimezoneConversions and TestTime classes, and finally the initial TestSubclassDateTime tests. Tests appear to be in alphabetical order by method name within each class, but the classes are in arbitrary order.
History
Date User Action Args
2015-11-14 13:34:34martin.pantersetrecipients: + martin.panter, belopolsky, vstinner, python-dev, serhiy.storchaka
2015-11-14 13:34:34martin.pantersetmessageid: <1447508074.66.0.525534025508.issue25168@psf.upfronthosting.co.za>
2015-11-14 13:34:34martin.panterlinkissue25168 messages
2015-11-14 13:34:34martin.pantercreate