FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.14] gh-158446: Reject float format precision near INT_MAX (GH-158474) by miss-islington · Pull Request #158477 · python/cpython · GitHub

Repository navigation

[3.14] gh-158446: Reject float format precision near INT_MAX (GH-158474) - #158477

Merged
gpshead merged 1 commit into
python:3.14from
miss-islington:backport-b7b4f3e-3.14
Sep 30, 2026
Merged

gpshead merged 1 commit into
python:3.14from
miss-islington:backport-b7b4f3e-3.14

Conversation

miss-islington commented Sep 30, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Formatting a float or complex with a precision within about 1000 of
INT_MAX could crash or produce incorrect output.
PyOS_double_to_string() now raises ValueError("precision too big") for
such precisions, as the format string parsers already do for
precisions above INT_MAX.

The limit applies regardless of presentation type or value, so a few
calls that previously succeeded (inf, nan, or 'g' with such a
precision) now raise as well.
(cherry picked from commit b7b4f3e)

Co-authored-by: Gregory P. Smith 68491+gpshead@users.noreply.github.com

…-158474)

Formatting a float or complex with a precision within about 1000 of
INT_MAX could crash or produce incorrect output.
PyOS_double_to_string() now raises ValueError("precision too big") for
such precisions, as the format string parsers already do for
precisions above INT_MAX.

The limit applies regardless of presentation type or value, so a few
calls that previously succeeded (inf, nan, or 'g' with such a
precision) now raise as well.
(cherry picked from commit b7b4f3e)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
bedevere-app Bot added type-bug An unexpected behavior, bug, or error type-security A security issue labels Sep 30, 2026
gpshead enabled auto-merge (squash) September 30, 2026 05:25
gpshead merged commit 4443885 into python:3.14 Sep 30, 2026
94 of 96 checks passed
miss-islington deleted the backport-b7b4f3e-3.14 branch September 30, 2026 08:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-blocker type-bug An unexpected behavior, bug, or error type-security A security issue

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL