gh-131434: Improve error reporting for incorrect format in strptime()#131568
gh-131434: Improve error reporting for incorrect format in strptime()#131568serhiy-storchaka merged 1 commit intopython:mainfrom
Conversation
…time() In particularly, fix regression in detecting stray % at the end of the format string.
802f440 to
4bff833
Compare
| @@ -0,0 +1 @@ | |||
| Improve error reporting for incorrect format in :func:`time.strptime`. | |||
There was a problem hiding this comment.
| Improve error reporting for incorrect format in :func:`time.strptime`. | |
| Fix error reporting for incorrect format in :func:`time.strptime`. |
It worked before ;-)
Also datetime strptime functions are affected.
I will review it more in detail later. It looks good from a glance
There was a problem hiding this comment.
Fixing the case for ending % is just a part of this PR. It improves error reporting for many more cases.
There was a problem hiding this comment.
I see, It was however also datetime strptimes
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…time() (pythonGH-131568) In particularly, fix regression in detecting stray % at the end of the format string. (cherry picked from commit 3feac7a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
|
GH-132309 is a backport of this pull request to the 3.13 branch. |
|
|
|
python/cpython#131568 Adapt the regex to handle both < 3.13 and >= 3.13 for this specific test case.
python/cpython#131568 Adapt the regex to handle both < 3.13 and >= 3.13 for this specific test case. Part-of: #219270 Related: odoo/enterprise#90352 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
python/cpython#131568 Adapt the regex to handle both < 3.13 and >= 3.13 for this specific test case.
python/cpython#131568 Adapt the regex to handle both < 3.13 and >= 3.13 for this specific test case. Part-of: #219300 Related: odoo/enterprise#90362 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
python/cpython#131568 Adapt the regex to handle both < 3.13 and >= 3.13 for this specific test case.
python/cpython#131568 Adapt the regex to handle both < 3.13 and >= 3.13 for this specific test case. Part-of: #219478 Related: odoo/enterprise#90447 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
python/cpython#131568 Adapt the regex to handle both < 3.13 and >= 3.13 for this specific test case.
python/cpython#131568 Adapt the regex to handle both < 3.13 and >= 3.13 for this specific test case. Part-of: #220147 Related: odoo/enterprise#90794 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
python/cpython#131568 Adapt the regex to handle both < 3.13 and >= 3.13 for this specific test case. Part-of: odoo#219300 Related: odoo/enterprise#90362 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
python/cpython#131568 Adapt the regex to handle both < 3.13 and >= 3.13 for this specific test case.
python/cpython#131568 Adapt the regex to handle both < 3.13 and >= 3.13 for this specific test case. Part-of: #220640 Related: odoo/enterprise#91053 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
In particularly, fix regression in detecting stray % at the end of the format string.
datetime.strptimeno longer raisesValueError: stray % in format '%Y %'#131434