Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[3.12] gh-130959: Reject whitespace in fractions, in pure Python fromisoformat() (GH-130962) (GH-131076) #131086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2025

Conversation

miss-islington
Copy link
Contributor

gh-130959: Reject whitespace in fractions, in pure Python fromisoformat() (GH-130962)

Fix the pure Python implementation of fromisoformat() to reject any
non-digit characters, including whitespace, in the fractional part
of time specification. This makes the behavior consistent with the C
implementation, and prevents incorrect parsing of these fractions
(e.g. .400 would be misinterpreted as .04).

Co-authored-by: Peter Bierma [email protected]
Co-authored-by: Paul Ganssle [email protected]
(cherry picked from commit 33494b4)
(cherry picked from commit 27fd328)

Co-authored-by: Victor Stinner [email protected]
Co-authored-by: Michał Górny [email protected]

…n `fromisoformat()` (pythonGH-130962) (pythonGH-131076)

pythongh-130959: Reject whitespace in fractions, in pure Python `fromisoformat()` (pythonGH-130962)

Fix the pure Python implementation of `fromisoformat()` to reject any
non-digit characters, including whitespace, in the fractional part
of time specification.  This makes the behavior consistent with the C
implementation, and prevents incorrect parsing of these fractions
(e.g. `.400 ` would be misinterpreted as `.04`).

Co-authored-by: Peter Bierma <[email protected]>
Co-authored-by: Paul Ganssle <[email protected]>
(cherry picked from commit 33494b4)
(cherry picked from commit 27fd328)

Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Michał Górny <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants