cpython/Python
Miss Islington (bot) 824836b660
[3.13] gh-158446: Reject float format precision near INT_MAX (GH-158474) (#158478)
gh-158446: Reject float format precision near INT_MAX (GH-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 b7b4f3ecf2)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-09-30 05:47:43 +00:00
..
clinic [3.13] gh-155952: Fix <unrepresentable> Argument Clinic defaults in several signatures (#156170) 2026-08-21 13:25:13 +01:00
frozen_modules
_warnings.c [3.13] gh-155952: Fix <unrepresentable> Argument Clinic defaults in several signatures (#156170) 2026-08-21 13:25:13 +01:00
adaptive.md
asdl.c
asm_trampoline.S
asm_trampoline_aarch64.h
assemble.c
ast.c [3.13] gh-85260: Extend the AST Validator to validate all identifiers (GH-21069) (GH-155653) 2026-08-13 05:59:34 +00:00
ast_opt.c
ast_unparse.c
bltinmodule.c
bootstrap_hash.c
brc.c
bytecodes.c
ceval.c
ceval_gil.c [3.13] gh-154175: Fetch _PY_GIL_DROP_REQUEST_BIT under GIL (#157013) 2026-09-29 23:24:31 +02:00
ceval_macros.h [3.13] gh-152375: Fix undefined behaviour in the INSTRUMENTED_JUMP macro (GH-152376) (#152577) 2026-06-29 10:04:56 +00:00
codecs.c
compile.c [3.13] gh-156466: fix cleanup on error after Enter in codegen_enter_scope (#156615) 2026-09-17 19:15:10 +01:00
condvar.h
config_common.h
context.c
critical_section.c
crossinterp.c
crossinterp_data_lookup.h
crossinterp_exceptions.h
dtoa.c [3.13] gh-158446: Reject float format precision near INT_MAX (GH-158474) (#158478) 2026-09-30 05:47:43 +00:00
dup2.c
dynamic_annotations.c
dynload_hpux.c
dynload_shlib.c
dynload_stub.c
dynload_win.c
emscripten_signal.c
emscripten_trampoline.c
errors.c
executor_cases.c.h
fileutils.c [3.13] gh-87587: Fix os.device_encoding() for any console on Windows (GH-155410) (GH-156597) 2026-08-29 18:42:14 +00:00
flowgraph.c
formatter_unicode.c
frame.c
frozen.c
frozenmain.c
future.c
gc.c
gc_free_threading.c
gc_gil.c
generated_cases.c.h
getargs.c
getcompiler.c
getcopyright.c
getopt.c
getplatform.c
getversion.c
hamt.c [3.13] gh-155515: Use GC tracking for HAMT iterators (GH-155517) (#155918) 2026-08-17 06:48:45 +03:00
hashtable.c
import.c
importdl.c
initconfig.c [3.13] gh-86427: Use the console code page for the stdio encoding on Windows (GH-155415) (GH-156604) 2026-08-29 19:49:44 +00:00
instruction_sequence.c
instrumentation.c [3.13] gh-151524: Make it clearer that _PyInstrumentation_DISABLE is immortal in the code (GH-151525) (GH-155351) 2026-08-07 15:52:49 +00:00
interpconfig.c
intrinsics.c
jit.c
legacy_tracing.c
lock.c
marshal.c
modsupport.c
mysnprintf.c
mystrtoul.c
object_stack.c
opcode_targets.h
optimizer.c
optimizer_analysis.c
optimizer_bytecodes.c
optimizer_cases.c.h
optimizer_symbols.c
parking_lot.c
pathconfig.c
perf_jit_trampoline.c [3.13] gh-156114: Fix crash in perf trampoline with unencodable code names (GH-156300) (#157774) 2026-09-18 21:27:16 +00:00
perf_trampoline.c [3.13] gh-156114: Fix crash in perf trampoline with unencodable code names (GH-156300) (#157774) 2026-09-18 21:27:16 +00:00
preconfig.c
pyarena.c
pyctype.c
pyfpe.c
pyhash.c
pylifecycle.c
pymath.c
pystate.c [3.13] gh-158364: Don't report other interpreters' threads in sys._current_frames (GH-158369) (GH-158473) 2026-09-30 02:54:58 +00:00
pystrcmp.c
pystrhex.c
pystrtod.c [3.13] gh-158446: Reject float format precision near INT_MAX (GH-158474) (#158478) 2026-09-30 05:47:43 +00:00
Python-ast.c
Python-tokenize.c
pythonrun.c [3.13] gh-152132: Test Py_CompileString() in test_capi.test_run (#153470) (#153473) (#153533) 2026-07-10 22:25:22 +00:00
pytime.c [3.13] gh-152849: Fix OverflowError message for out-of-range timestamps in the time module (GH-152850) (#153207) 2026-07-06 15:13:32 +00:00
qsbr.c
README
specialize.c
stdlib_module_names.h
structmember.c [3.13] gh-156196: Fix a failed assignment to a PyMemberDef attribute changing its value (GH-156197) 2026-08-21 16:00:39 +00:00
suggestions.c
symtable.c [3.13] gh-152682: Fix NULL dereference on OOM in symtable_visit_type_param_bound_or_default (GH-152684) (#152697) 2026-07-06 17:36:17 +01:00
sysmodule.c
thread.c
thread_nt.h
thread_pthread.h [3.13] gh-154283: Make threading.get_native_id() unique across processes on DragonFly (GH-154287) (GH-154298) 2026-07-20 23:04:40 +03:00
thread_pthread_stubs.h
tier2_engine.md
traceback.c
tracemalloc.c
vm-state.md

Miscellaneous source files for the main Python shared library