Bug in strptime in Python 2.3.3

Glawster andywil at nortelnetworks.com
Fri Jun 11 06:45:44 EDT 2004


I reported this in an earlier thread and Holger Joukl kindly supplied
me with a patch I could apply to _strptime.py

I still think there is something missing in the way %w is handled
(note: it is lower case for weekday)

I'd like to know what is missing in _strptime.py for %w handling
between pre-python 2.3 and post 2.3?

I'd also like to know how I can get this into a new release as a
solution, I am willing to do this if someone can point me in the right
direction. Even better if someone "owns" this routine already and will
take it on for us.

To recap:-

> I am parsing a list of directories that have a name format
> 'YearWeekNoDay', using the follwoing code
>
>             print list dir[j]
>             print "%s" % (time.strptime (list dir[j], '%Y%U%w'))
>             ttuple = time.strptime (list dir[j], '%Y%U%w')
>             year   = ttuple[0]
>             month  = ttuple[1]
>             day    = ttuple[2]
>             print day, month, year
>
> I get the following output:
>
> 2004123
> (2004, 1, 1, 0, 0, 0, 2, 1, -1)
> 1 1 2004
>
> 2004124
> (2004, 1, 1, 0, 0, 0, 3, 1, -1)
> 1 1 2004



More information about the Python-list mailing list