Bugs item #1633628, was opened at 2007-01-12 00:44
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1633628&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.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Matthias Klose (doko)
Assigned to: Nobody/Anonymous (nobody)
Summary: time.strftime() accepts format which time.strptime doesnt

Initial Comment:
[forwarded from http://bugs.debian.org/354636]

time.strftime() accepts '%F %T' as format but time.strptime() doesn't, if
the rule is "all what strftime accepts strptime must also" then that is
bad. Check this:

darwin:~# python2.4
Python 2.4.2 (#2, Nov 20 2005, 17:04:48) 
[GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> format = '%F %T'
>>> t = time.strftime(format)
>>> t
'2006-02-27 18:09:37'
>>> time.strptime(t,format)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/_strptime.py", line 287, in strptime
    format_regex = time_re.compile(format)
  File "/usr/lib/python2.4/_strptime.py", line 264, in compile
    return re_compile(self.pattern(format), IGNORECASE)
  File "/usr/lib/python2.4/_strptime.py", line 256, in pattern
    processed_format = "%s%s%s" % (processed_format,
KeyError: 'F'
>>> 


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1633628&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to