[issue23136] BUG in how _strptime() handles week 0

Alexander Belopolsky report at bugs.python.org
Wed Dec 31 17:41:49 CET 2014


Alexander Belopolsky added the comment:

In a comment for #23134, Serhiy suggested that this may not be a bug (msg233215) because C strptime behavior for this case is undefined.

I disagree.  On Mac OSX, strptime man page states:

"""
     The %U and %W format specifiers accept any value within the range 00 to 53 without validat-
     ing against other values supplied (like month or day of the year, for example).
"""

And for the data="0 2015 2", format="%W %Y %w" case, it produces 2015-12-30 00:00:00 as expected.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23136>
_______________________________________


More information about the Python-bugs-list mailing list