[issue24929] _strptime.TimeRE should not enforce range in regex

2021-05-21 Thread Catherine Devlin
Catherine Devlin added the comment: Thinking about this a little more... I suggest that slowing down execution shouldn't be a worry in this case, because trying to parse a garbage string into a date shouldn't be something code is doing zillions of times, and if it is, being slow isn't a

[issue24929] _strptime.TimeRE should not enforce range in regex

2021-05-19 Thread Catherine Devlin
Catherine Devlin added the comment: Can we close the ticket? It doesn't sound like we're going to go with anything like this approach. If there's a good place to record the general ambitions (better strptime tests, more clear strptime errors), that would be good, but I don't think we use

[issue24929] _strptime.TimeRE should not enforce range in regex

2021-05-18 Thread Paul Ganssle
Paul Ganssle added the comment: I also commented on GH-26215 ( https://github.com/python/cpython/pull/26215 ), but for posterity, I'll note a few things: 1. It seems that (and this may have changed since 2015), `_strptime._strptime` now has a stage that (unconditionally?) constructs a

[issue24929] _strptime.TimeRE should not enforce range in regex

2021-05-18 Thread Catherine Devlin
Change by Catherine Devlin : -- keywords: +patch nosy: +Catherine.Devlin nosy_count: 2.0 -> 3.0 pull_requests: +24832 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/26215 ___ Python tracker

[issue24929] _strptime.TimeRE should not enforce range in regex

2020-06-05 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24929] _strptime.TimeRE should not enforce range in regex

2015-09-02 Thread R. David Murray
R. David Murray added the comment: A unit test in test_strptime. -- ___ Python tracker ___ ___

[issue24929] _strptime.TimeRE should not enforce range in regex

2015-09-01 Thread Steve Yeung
Steve Yeung added the comment: I'm not sure what format I'm supposed to provide the test in. I attached a file that has the diff of the changes I made, and how the error message is changed (and improved!) in both datetime and time. -- Added file: http://bugs.python.org/file40319/file

[issue24929] _strptime.TimeRE should not enforce range in regex

2015-08-25 Thread Brett Cannon
Brett Cannon added the comment: Do realize that the strptime code is shared with time.strptime() and so this change would have to make sense in both contexts. This change can also only happen in Python 3.6 because it is backwards-incompatible due to people potentially already catching the

[issue24929] _strptime.TimeRE should not enforce range in regex

2015-08-24 Thread Steve Yeung
New submission from Steve Yeung: Currently, the regex in TimeRE enforces the numeric ranges. For example: 'm': r(?Pm1[0-2]|0[1-9]|[1-9]), As a result, an invalid month will cause an generic regex error: ValueError: time data '2015/16/5' does not match format '%Y/%m/%d' However, if we