[issue23717] strptime() with year-weekday pair can produce invalid data

2021-11-29 Thread Irit Katriel
Irit Katriel added the comment: Reproduced on 3.11. -- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5 ___ Python tracker _

[issue23717] strptime() with year-weekday pair can produce invalid data

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agree. But may be at least emit a warning? -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue23717] strptime() with year-weekday pair can produce invalid data

2015-03-20 Thread Skip Montanaro
Skip Montanaro added the comment: time.strptime('2015 3 20 0', '%Y %m %d %w') > time.struct_time(tm_year=2015, tm_mon=3, tm_mday=20, tm_hour=0, tm_min=0, > tm_sec=0, tm_wday=6, tm_yday=79, tm_isdst=-1) > > All date values are known, the problem is that they contradict. Garbage in, garbage

[issue23717] strptime() with year-weekday pair can produce invalid data

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually you can got invalid data for any date. >>> time.strptime('2015 3 20', '%Y %m %d') time.struct_time(tm_year=2015, tm_mon=3, tm_mday=20, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=4, tm_yday=79, tm_isdst=-1) >>> time.strptime('2015 3 20 0', '%Y %m %d %w')

[issue23717] strptime() with year-weekday pair can produce invalid data

2015-03-20 Thread Skip Montanaro
Skip Montanaro added the comment: I don't think this is a bug. From the 2.7.9 docs: The default values used to fill in any missing data when more accurate values cannot be inferred are (1900, 1, 1, 0, 0, 0, 0, 1, -1). -- nosy: +skip.montanaro ___ Py

[issue23717] strptime() with year-weekday pair can produce invalid data

2015-03-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: strptime() with year-weekday pair can produce invalid data. >>> time.strptime('2015 0', '%Y %w') time.struct_time(tm_year=2015, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=1, tm_isdst=-1) >>> time.strptime('2015 1', '%Y %w') time.