[issue19376] datetime.datetime.strptime without a year fails on Feb 29

STINNER Victor report at bugs.python.org
Thu Oct 24 13:21:49 CEST 2013


STINNER Victor added the comment:

I don't think that the issue can be called a bug. If we pick another year (ex: 1904), you cannot compare two datetimes anymore:
"This solution has some very undesirable properties - namely that Mar 1st is now less than Feb 29th!"
http://bugs.python.org/issue14157#msg160637

If you want to handle "Feb 29", add an explicit year.

This issue is maybe a documentation issue: datetime.datetime.strptime() should warn users that calling datetime.datetime.strptime() without year may fail for Feb 29.

----------

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


More information about the Python-bugs-list mailing list