Bug in strptime in Python 2.3.3

Discussion in 'Python' started by Glawster, Jun 11, 2004.

  1. Glawster

    Glawster Guest

    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
    Glawster, Jun 11, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Henk-Jan de Jong

    Bug in strptime?

    Henk-Jan de Jong, Oct 26, 2003, in forum: Python
    Replies:
    4
    Views:
    363
    Henk-Jan de Jong
    Oct 29, 2003
  2. kongkolvyu
    Replies:
    4
    Views:
    476
    Old Wolf
    Jan 4, 2006
  3. W. eWatson
    Replies:
    5
    Views:
    307
    W. eWatson
    Sep 9, 2008
  4. TYR
    Replies:
    2
    Views:
    1,194
  5. pythonista

    strptime dilemma with Python 2.5

    pythonista, May 30, 2010, in forum: Python
    Replies:
    2
    Views:
    645
    pythonista
    May 30, 2010
Loading...

Share This Page