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 2012年06月24日 19:43 by skrah, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (9) | |||
|---|---|---|---|
| msg163827 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2012年06月24日 19:43 | |
I'm getting this failure in test_email (Windows 64-bit build): ====================================================================== ERROR: test_localtime_epoch_notz_daylight_false (test_utils.LocaltimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Users\stefan\pydev\cpython\lib\test\test_email\test_utils.py", line 112, in test_localtime_epoch_notz_dayl ight_false t1 = utils.localtime(t0) File "C:\Users\stefan\pydev\cpython\lib\email\utils.py", line 397, in localtime seconds = time.mktime(tm) OverflowError: mktime argument out of range ====================================================================== ERROR: test_localtime_epoch_notz_daylight_true (test_utils.LocaltimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Users\stefan\pydev\cpython\lib\test\test_email\test_utils.py", line 105, in test_localtime_epoch_notz_dayl ight_true t1 = utils.localtime(t0) File "C:\Users\stefan\pydev\cpython\lib\email\utils.py", line 397, in localtime seconds = time.mktime(tm) OverflowError: mktime argument out of range |
|||
| msg163851 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年06月24日 20:35 | |
Same here with VS 2008. |
|||
| msg163856 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年06月24日 20:46 | |
I haven't touched localtime since pycon, so I presume this hasn't been detected before due to our lack of a windows 64bit buildbot. |
|||
| msg163865 - (view) | Author: Alexander Belopolsky (Alexander.Belopolsky) | Date: 2012年06月24日 21:21 | |
I don't have a Win 64 setup, but I think replacing 1970 with say 1990 in the tests should fix the problem. |
|||
| msg163993 - (view) | Author: Alexander Belopolsky (belopolsky) * (Python committer) | Date: 2012年06月25日 17:07 | |
I am surprised that we don't see the same failure on 32-bit windows buildbot. Windows mktime does not support negative time_t in either 32 or 64 bit version: http://msdn.microsoft.com/en-us/library/d1y53h2a(v=vs.110).aspx We are probably just lucky and no Windows buildbot uses a TZ set ahead of UTC. Stefan, what is your timezone? What is happening here is that mktime() is called for 1970年01月01日 00:00 which results in positive timestamp for the timezones west of Greenwich and negative timestamp east of Greenwich. For example, using GNU date: $ TZ=Europe/Paris date -d "1970-01-01 00:00" +%s -3600 $ TZ=America/New_York date -d "1970-01-01 00:00" +%s 18000 I am adding Victor as an expert on pushing the limits of date/time functions. |
|||
| msg163994 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2012年06月25日 17:24 | |
My timezone is CET, so that fits your explanation. Indeed, the failure also occurs on Windows 32-bit. |
|||
| msg163995 - (view) | Author: Alexander Belopolsky (belopolsky) * (Python committer) | Date: 2012年06月25日 17:33 | |
Is this something that has to be fixed during the freeze? The fix is trivial: s/1970/1990/g, but I planned to revisit TZ-dependent tests during the beta period. I think we don't use run_with_tz() enough. It would also be great to make it work on windows. |
|||
| msg174858 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年11月05日 01:06 | |
New changeset 367e376e5ba2 by Victor Stinner in branch '3.3': Close #15165: Fix test_email on Windows 64 bits http://hg.python.org/cpython/rev/367e376e5ba2 New changeset 651e8613e579 by Victor Stinner in branch 'default': (Merge 3.3) Close #15165: Fix test_email on Windows 64 bits http://hg.python.org/cpython/rev/651e8613e579 |
|||
| msg174859 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年11月05日 01:12 | |
This issue is not related to the email module, but it is a Windows limitation: datetime.datetime(1970, 1, 1).timestamp() raises a same OverflowError. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:32 | admin | set | github: 59370 |
| 2012年11月05日 01:12:48 | vstinner | set | messages: + msg174859 |
| 2012年11月05日 01:06:23 | python-dev | set | status: open -> closed nosy: + python-dev messages: + msg174858 resolution: fixed stage: resolved |
| 2012年06月25日 17:33:33 | belopolsky | set | assignee: belopolsky messages: + msg163995 |
| 2012年06月25日 17:24:56 | skrah | set | messages:
+ msg163994 title: test_email: failure on Windows 64-bit -> test_email: failure on Windows |
| 2012年06月25日 17:07:21 | belopolsky | set | nosy:
+ vstinner messages: + msg163993 |
| 2012年06月24日 21:21:16 | Alexander.Belopolsky | set | nosy:
+ Alexander.Belopolsky messages: + msg163865 |
| 2012年06月24日 20:46:46 | r.david.murray | set | priority: normal -> high nosy: + belopolsky, barry messages: + msg163856 components: + email |
| 2012年06月24日 20:35:18 | pitrou | set | nosy:
+ pitrou messages: + msg163851 |
| 2012年06月24日 19:43:57 | skrah | create | |