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.

classification
Title: test_strptime fails on Linux
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, doerwalter, hdima, prjsf
Priority: normal Keywords:

Created on 2003-06-30 07:33 by hdima, last changed 2022-04-10 16:09 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
_tz_fix.diff brett.cannon, 2003-07-01 01:46 Proposed fix
tz_fix2.diff brett.cannon, 2003-07-01 07:42 Another fix that removes the time.tzset call
tz_daylight.diff brett.cannon, 2003-07-02 21:34 Adds better checks for duplicate values in time.tzname by checking time.daylight
Messages (15)
msg16693 - (view) Author: Dmitry Vasiliev (hdima) Date: 2003-06-30 07:33
Python 2.3b2+ (#1, Jun 30 2003, 10:50:39)
Linux version 2.4.18-19.7asp

test_strptime
test test_strptime failed -- Traceback (most recent
call last):
  File
"/home/dima/src/other/python/dist/src/Lib/test/test_strptime.py",
line 312, in test_timezone
    "LocaleTime().timezone has duplicate values but "
  File
"/home/dima/src/other/python/dist/src/Lib/unittest.py",
line 268, in failUnless
    if not expr: raise self.failureException, msg
AssertionError: LocaleTime().timezone has duplicate
values but timzone value not set to -1

1 test failed:
    test_strptime
msg16694 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2003-06-30 12:04
Logged In: YES 
user_id=89016

This might be a duplicate of 763052, which reported to same
error under Windows.
msg16695 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-06-30 23:43
Logged In: YES 
user_id=357491

It is the same error and I am 99% sure I know the problem 
(stupid mistake on my part in the test).  As soon as I am done 
recompiling I will fix it locally and see if it takes.
msg16696 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-07-01 01:46
Logged In: YES 
user_id=357491

So it wasn't what I thought it would be.  But I do think I found the 
error.  Dmitry, can you apply the patch that I attached to the 
report and see if it fixes the problem?
msg16697 - (view) Author: Dmitry Vasiliev (hdima) Date: 2003-07-01 07:25
Logged In: YES 
user_id=388573

No, the same error remains
msg16698 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-07-01 07:42
Logged In: YES 
user_id=357491

Damn.  OK, lets take Raymond's suggestion and try removing the 
time.tzset call.  Try the new patch and let me know how it goes.

Also, when was the last time you ran the test and it passed?  I am 
trying to isolate if this is all happening because of my attempt to 
take time.daylight into account.
msg16699 - (view) Author: Dmitry Vasiliev (hdima) Date: 2003-07-01 08:01
Logged In: YES 
user_id=388573

Maybe it may helps: locale_time.timezone is ['UTC', 'GMT',
'UTC', ''] during testing
msg16700 - (view) Author: Dmitry Vasiliev (hdima) Date: 2003-07-01 09:32
Logged In: YES 
user_id=388573

New patch produce new error:
-----------------------------
test_strptime
test test_strptime failed -- Traceback (most recent call last):
  File
"/home/dima/src/other/python/dist/src/Lib/test/test_strptime.py",
line 299, in test_timezone
    self.failUnlessEqual(strp_output.tm_isdst, 0)
  File
"/home/dima/src/other/python/dist/src/Lib/unittest.py", line
292, in failUnlessEqual
    raise self.failureException, \
AssertionError: -1 != 0

1 test failed:
    test_strptime
------------------------------

Last time when I ran the test and it passed it was Python
2.3b1 (#1, Apr 28 2003, 11:09:08).
msg16701 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-07-01 10:03
Logged In: YES 
user_id=357491

What is time.tzname and time.daylight set for both of you guys?
msg16702 - (view) Author: Dmitry Vasiliev (hdima) Date: 2003-07-01 10:41
Logged In: YES 
user_id=388573

Python 2.3b2+ (#1, Jul  1 2003, 10:37:33)
[GCC 2.96 20000731 (ASPLinux 7.3 2.96-112)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import time
>>> time.tzname
('UTC', 'UTC')
>>> time.daylight
0
>>>
msg16703 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-07-01 20:27
Logged In: YES 
user_id=357491

I knew it.  Okay, I know exactly what the issue is and I came up 
with a way to deal with it.  Problem is that I need to completely 
restructure how timezones are handled to do it.  But it will 
simplify the code and help remove special casing.

Unfortunately I am going to be taking a rather long drive today so 
I won't get to this today (I think; I have been known to say this 
and make it turn out to be a lie =).  But I will get it down this 
week and have a patch to test.
msg16704 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-07-02 21:34
Logged In: YES 
user_id=357491

OK, so I didn't need to completely restructure how timezones are 
handled (although I will for Python 2.4).  The new patch adds a 
check to see if time.daylight is true or not to decide whether it 
should worry about duplicate values in time.tzname .
msg16705 - (view) Author: Paul Jarc (prjsf) Date: 2003-07-02 23:10
Logged In: YES 
user_id=412110

I had the same problem; tz_daylight.diff indeed fixes it for me.
msg16706 - (view) Author: Dmitry Vasiliev (hdima) Date: 2003-07-03 09:12
Logged In: YES 
user_id=388573

Ok, tz_daylight.diff fixes the problem.
msg16707 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-07-03 20:01
Logged In: YES 
user_id=357491

OK, cleaned up a little and applied as rev 1.20 and 1.17 for Lib/
_strptime.py and Lib/test/test_strptime.py, repectively.

Thanks to everyone who tested the fix.
History
Date User Action Args
2022-04-10 16:09:32adminsetgithub: 38745
2003-06-30 07:33:52hdimacreate