[issue14157] time.strptime without a year fails on Feb 29

Martin Morrison report at bugs.python.org
Mon May 14 18:50:16 CEST 2012


Martin Morrison <martin.morrison at gmail.com> added the comment:

This solution has some very undesirable properties - namely that Mar 1st is now less than Feb 29th!

It seems like the correct follow up fix would be to adjust the date of the returned struct_time back to 1900. The struct_time object doesn't have the validation issue, so this works fine. This pair of fixes then nicely circumvents the intermediate datetime object's checking, while providing a consistent end result.

----------

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


More information about the Python-bugs-list mailing list