classification
Title: test_time.test_tzset() fails on "x86 FreeBSD 7.2 3.x": AEST timezone called "EST"
Type: Stage:
Components: Library (Lib), Tests Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, belopolsky, flox, neologix, python-dev, vstinner
Priority: normal Keywords: patch

Created on 2011-04-20 13:53 by vstinner, last changed 2014-06-29 16:05 by vstinner. This issue is now closed.

Files
File name Uploaded Description Edit
time_aest.patch vstinner, 2011-11-24 15:27 review
Messages (14)
msg134153 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-04-20 13:53
test_time.test_tzset() fails on "x86 FreeBSD 7.2 3.x": 'AEST-10AEDT-11,M10.5.0,M3.5.0' timezone becomes 'EST'.
======================================================================
FAIL: test_tzset (test.test_time.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_time.py", line 209, in test_tzset
    self.assertTrue(time.tzname[0] == 'AEST', str(time.tzname[0]))
AssertionError: False is not true : EST

----------------------------------------------------------------------
http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%207.2%203.x/builds/1705/steps/test/logs/stdio

See also http://en.wikipedia.org/wiki/Time_in_Australia
msg134174 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2011-04-20 19:31
On Wed, Apr 20, 2011 at 9:53 AM, STINNER Victor <report@bugs.python.org> wrote:
..
> test_time.test_tzset() fails on "x86 FreeBSD 7.2 3.x": 'AEST-10AEDT-11,M10.5.0,M3.5.0' timezone becomes 'EST'.

I was able to reproduce this error by faking a file named
'AEST-10AEDT-11,M10.5.0,M3.5.0' in /usr/share/zoneinfo/ on Mac OS X.
(As far as I know, OSX is not that different from BSD with respect to
basic posix interfaces.)

$ cd /usr/share/zoneinfo/
$ sudo cp EST AEST-10AEDT-11,M10.5.0,M3.5.0

Is it possible that the buildbot has such a file?  What I find strange
is that autoconf logic tests for working tzset using exactly the same
TZ spec:

"""
        putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0");
        tzset();
        if (localtime(&groundhogday)->tm_hour != 11)
            exit(1);
#if HAVE_TZNAME
        if (strcmp(tzname[0], "AEST") || strcmp(tzname[1], "AEDT"))
            exit(1);
#endif
"""  See 'configure' script.

In other words, if TZ=AEST-10AEDT-11,M10.5.0,M3.5.0 breaks tzset, this
should be detected at the configure stage and the tzset tests should
be skipped.   Is there a way to force configure run on the bot?
msg148262 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-11-24 15:17
Issue #13313 has been marked as a duplicate of this issue. Interesting message from flox:

"Maybe it is related.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=93810

Ambiguous timezone names (AEST vs EST)"
msg148263 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-11-24 15:18
> Is there a way to force configure run on the bot?

./configure is run for each build of each buildbot.
msg148265 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-11-24 15:27
I don't see this issue as a bug in Python, but just that the timezone database is different on some OSes. Can't we just accept both names, AEST and EST? Attached patch changes test_time to tolerate EST name for 'AEST-10AEDT-11,M10.5.0,M3.5.0' ("Victoria") time zone.
msg148892 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-12-05 22:06
Alex ? Florent ?
msg149004 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-12-07 23:32
New changeset c143e66e5efe by Victor Stinner in branch '3.2':
Issue #11886: workaround an OS bug (time zone data) in test_time
http://hg.python.org/cpython/rev/c143e66e5efe

New changeset c7638be1e430 by Victor Stinner in branch 'default':
(Merge 3.2) Issue #11886: workaround an OS bug (time zone data) in test_time
http://hg.python.org/cpython/rev/c7638be1e430

New changeset 2bca2cee79a1 by Victor Stinner in branch '2.7':
Issue #11886: workaround an OS bug (time zone data) in test_time
http://hg.python.org/cpython/rev/2bca2cee79a1
msg149120 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-12-09 20:28
The FreeBSD 7.2 3.x buildbot is green.
msg149126 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2011-12-09 21:25
thank you for this fix.
I agree a posteriori.
msg149153 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-12-10 13:37
New changeset e37a7dc8944e by Victor Stinner in branch 'default':
Issue #11886: Fix also test_time for the non-DST timezone name (EST/AEST)
http://hg.python.org/cpython/rev/e37a7dc8944e
msg149263 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-12-12 01:06
Hum, it's still not ok:



======================================================================
FAIL: test_tzset (test.test_time.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_time.py", line 264, in test_tzset
    self.assertEqual(time.timezone, -36000)
AssertionError: 18000 != -36000
msg149463 - (view) Author: Charles-Fran├žois Natali (neologix) * (Python committer) Date: 2011-12-14 18:33
Another failure on a 2.7 FreeBSD buildbot:
"""
test test_time failed -- Traceback (most recent call last):
  File "/usr/home/db3l/buildarea/2.7.bolen-freebsd7/build/Lib/test/test_time.py", line 193, in test_tzset
    self.assertTrue(time.tzname[1] == 'AEDT', str(time.tzname[1]))
AssertionError: EDT
"""

http://www.python.org/dev/buildbot/all/builders/x86 FreeBSD 7.2 2.7/builds/859/steps/test/logs/stdio
msg178891 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-01-03 01:53
What is the status of this issue? Was the failure reproduced recently?
msg221853 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-29 15:51
Can this be closed as "out of date"?
History
Date User Action Args
2014-06-29 16:05:59vstinnersetstatus: open -> closed
resolution: fixed
2014-06-29 15:51:46BreamoreBoysetnosy: + BreamoreBoy
messages: + msg221853
2013-01-03 01:53:25vstinnersetmessages: + msg178891
2011-12-14 18:33:30neologixsetnosy: + neologix
messages: + msg149463
2011-12-12 01:06:46vstinnersetstatus: closed -> open
resolution: fixed -> (no value)
messages: + msg149263
2011-12-10 13:37:58python-devsetmessages: + msg149153
2011-12-09 21:25:49floxsetmessages: + msg149126
2011-12-09 20:28:06vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg149120
2011-12-07 23:32:59python-devsetnosy: + python-dev
messages: + msg149004
2011-12-05 22:06:15vstinnersetmessages: + msg148892
2011-11-24 15:27:34vstinnersetfiles: + time_aest.patch
keywords: + patch
messages: + msg148265
2011-11-24 15:18:35vstinnersetmessages: + msg148263
2011-11-24 15:17:20vstinnersetnosy: + flox
messages: + msg148262
2011-04-20 19:31:11belopolskysetmessages: + msg134174
2011-04-20 13:53:12vstinnercreate