New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_email: test_localtime_daylight_false_dst_true() fails depending on the timezone #79498
Comments
The two following tests fail on glibc-2.28.9000-19.fc30.x86_64 on Fedora Rawhide depending on the timezone. Australia/Lord_Howe: ok <mock-chroot> sh-4.4# TZ=UTC ./python -m test test_email -m 'test_localtime_daylight_*' -v ====================================================================== Traceback (most recent call last):
File "/builddir/Python-3.7.1/Lib/test/test_email/test_utils.py", line 88, in test_localtime_daylight_false_dst_true
t1 = utils.localtime(t0, isdst=1)
File "/builddir/Python-3.7.1/Lib/email/utils.py", line 361, in localtime
seconds = time.mktime(tm)
OverflowError: mktime argument out of range ====================================================================== Traceback (most recent call last):
File "/builddir/Python-3.7.1/Lib/test/test_email/test_utils.py", line 81, in test_localtime_daylight_true_dst_true
t1 = utils.localtime(t0, isdst=1)
File "/builddir/Python-3.7.1/Lib/email/utils.py", line 361, in localtime
seconds = time.mktime(tm)
OverflowError: mktime argument out of range Ran 4 tests in 0.007s FAILED (errors=2) == Tests result: FAILURE == 1 test failed: Total duration: 259 ms <mock-chroot> sh-4.4# rpm -q glibc |
mktime_bug.py: script to reproduce the bug. |
I found a C reproducer and reported to Fedora glibc tracker: https://bugzilla.redhat.com/show_bug.cgi?id=1653340 |
Miro Hrončok:
Nice, I wrote almost the same one :-) See attached mktime_bug.c: $ gcc mktime_bug.c -o mktime_bug
$ ./mktime_bug
TZ=CET: mktime() -> 1331506860, errno=0
TZ=UTC: mktime() -> 1331514060, errno=0
$ ./mktime_bug
TZ=CET: mktime() -> 1331506860, errno=0
TZ=UTC: mktime() -> -1, errno=75 |
I'm able to reproduce the issue on FreeBSD 12.0-RC2: vstinner@freebsd$ TZ=CET ./python -m test test_email -m 'test_localtime_daylight_*' -v vstinner@freebsd$ TZ=UTC ./python -m test test_email -m 'test_localtime_daylight_*' -v ====================================================================== |
Oh, the tests fail since 2012 at least on FreeBSD: https://bugs.python.org/issue15750#msg168741 """ ====================================================================== Traceback (most recent call last):
(...)
seconds = time.mktime(tm)
OverflowError: mktime argument out of range ====================================================================== Traceback (most recent call last):
(...)
seconds = time.mktime(tm)
OverflowError: mktime argument out of range
""" bpo-15750 even contains a reproducer in C. |
Python 2.7 doesn't seem to be affected: $ TZ=UTC ./python -m test -v test_email
Tests result: SUCCESS |
The test still fails if the timezone database is not available. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: