SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

0 0 0 Python

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

* gh-130959: Reject whitespace in fractions, in pure Python `fromisoformat()`

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`).

* Add the news entry

* Use a different example to fix Sphinx lint

* Apply suggestions from code review

Co-authored-by: Peter Bierma <[email protected]>
Co-authored-by: Paul Ganssle <[email protected]>

* Try fixing `:func:` ref.

---------

Co-authored-by: Peter Bierma <[email protected]>
Co-authored-by: Paul Ganssle <[email protected]>
M
Michał Górny committed
33494b4d0dafc34ff4f1c118b7b3b5d8de3dd0f4
Parent: 69309a5
Committed by GitHub <[email protected]> on 3/11/2025, 9:15:40 AM