[issue39422] datetime.datetime.strptime incorrectly interpretting format '%Y%m%d'

2020-01-22 Thread Cleland Loszewski
Cleland Loszewski added the comment: You're right, I did mean the second string to report '20200106'. Looking closer, I see that I was reading the documentation incorrectly and getting hung up on an introduced ambiguity. ```python from datetime import datetime print(datetime.strptime('202001

[issue39422] datetime.datetime.strptime incorrectly interpretting format '%Y%m%d'

2020-01-22 Thread SilentGhost
SilentGhost added the comment: They do not "report same datetime output". Did you mean to use '20200106' as the second input string? Because, leading zeros being optional for certain format specifiers is a documented feature of strptime. -- nosy: +SilentGhost status: open -> pending

[issue39422] datetime.datetime.strptime incorrectly interpretting format '%Y%m%d'

2020-01-22 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +belopolsky, p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue39422] datetime.datetime.strptime incorrectly interpretting format '%Y%m%d'

2020-01-22 Thread Cleland Loszewski
New submission from Cleland Loszewski : ```python from datetime import datetime print(datetime.strptime('2020016', '%Y%m%d')) print(datetime.strptime('20200116', '%Y%m%d')) ``` The former string has a format that does not match '%Y%m%d', but the latter does. Both report the same datatime outpu