[issue33941] datetime.strptime not able to recognize invalid date formats

2018-07-05 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue33941] datetime.strptime not able to recognize invalid date formats

2018-06-22 Thread Chris Wilcox
Chris Wilcox added the comment: I looked a bit at _strptime.py and the corresponding tests and thought I would share my notes. The regular expressions clearly allow non-zero padded values for both %d and %m matches. There is one test where the following is run: time.strptime("Mar 1", "%b %d

[issue33941] datetime.strptime not able to recognize invalid date formats

2018-06-22 Thread Ned Deily
Change by Ned Deily : -- nosy: +belopolsky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue33941] datetime.strptime not able to recognize invalid date formats

2018-06-22 Thread Chris Wilcox
Chris Wilcox added the comment: As %m and %d denote zero padded forms of month and day it seems to me this shouldn't match. Executing a small c program `char* ret = strptime("181223", "%Y%m%d", &tm);` confirms that this is considered invalid to c. The datetime docs indicate that the behavior

[issue33941] datetime.strptime not able to recognize invalid date formats

2018-06-22 Thread Raghunath Lingutla
New submission from Raghunath Lingutla : Can not recognize invalid date values for %Y%m%d, %y%m%d, %Y%m%d %H:%M and few more formats. In Java we have setLenient option which help us to validate to pattern and convert only valid formats Ex: datetime.strptime('181223', '%Y%m%d') For above input