Message261027
This is not no more bug than
>>> from datetime import *
>>> datetime.strptime('0228', '%m%d')
datetime.datetime(1900, 2, 28, 0, 0)
Naturally, as long as datetime.strptime('0228', '%m%d') is the same as datetime.strptime('19000228', '%Y%m%d'), datetime.strptime('0229', '%m%d') should raise a ValueError as long as datetime.strptime('19000229', '%m%d') does.
The only improvement, I can think of in this situation is to point the user to time.strptime() in the error message. The time.strptime method works just fine in the recent versions (see issue 14157.)
>>> time.strptime('0229', '%m%d')[1:3]
(2, 29) |
|
Date |
User |
Action |
Args |
2016-02-29 22:51:30 | belopolsky | set | recipients:
+ belopolsky, gregory.p.smith, Sriram Rajagopalan |
2016-02-29 22:51:30 | belopolsky | set | messageid: <1456786290.35.0.954487768559.issue26460@psf.upfronthosting.co.za> |
2016-02-29 22:51:30 | belopolsky | link | issue26460 messages |
2016-02-29 22:51:30 | belopolsky | create | |
|