[ python-Bugs-1643943 ] strptime %U broken

SourceForge.net noreply at sourceforge.net
Thu Jan 25 19:50:44 CET 2007


Bugs item #1643943, was opened at 2007-01-24 15:00
Message generated for change (Comment added) made by bcannon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1643943&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Brian Nahas (bnahas)
>Assigned to: Brett Cannon (bcannon)
Summary: strptime %U broken

Initial Comment:
Python 2.4.1 (#1, May 16 2005, 15:19:29)
[GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from time import strptime
>>> strptime('2006-53-0', '%Y-%U-%w')
(2006, 12, 31, 0, 0, 0, 6, 365, -1)
>>> strptime('2007-00-0', '%Y-%U-%w')
(2006, 12, 24, 0, 0, 0, 6, -7, -1)
>>> strptime('2007-01-0', '%Y-%U-%w')
(2007, 1, 7, 0, 0, 0, 6, 7, -1)
>>> strptime('2007-02-0', '%Y-%U-%w')
(2007, 1, 7, 0, 0, 0, 6, 7, -1)
>>> strptime('2007-03-0', '%Y-%U-%w')
(2007, 1, 14, 0, 0, 0, 6, 14, -1)
>>>


Note that in the above test, Sunday of week 1 and week 2 for 2007 reported the date as 2007-01-07 and Sunday of week 0 was reported as 2006-12-24, not 2006-12-31.  I'm not sure exactly what is correct, but the inconsistencies are bothersome.

Same results on:
Python 2.4.4c1 (#70, Oct 11 2006, 10:59:14) [MSC v.1310 32 bit (Intel)] on win32


----------------------------------------------------------------------

>Comment By: Brett Cannon (bcannon)
Date: 2007-01-25 10:50

Message:
Logged In: YES 
user_id=357491
Originator: NO

I will try to fix this when I can.  Just to warn you, Brian, I really
doubt I will put the effort into backporting this to 2.4.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1643943&group_id=5470


More information about the Python-bugs-list mailing list