Skip to content

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 zintensitydev@gmail.com
Co-authored-by: Paul Ganssle 1377457+pganssle@users.noreply.github.com
(cherry picked from commit 33494b4)
(cherry picked from commit 27fd328)

Co-authored-by: Victor Stinner vstinner@python.org
Co-authored-by: Michał Górny mgorny@gentoo.org

…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 <zintensitydev@gmail.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
(cherry picked from commit 33494b4)
(cherry picked from commit 27fd328)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Michał Górny <mgorny@gentoo.org>
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