Open
Description
PyConfig
is for configuring the runtime during initialization, not for storing runtime state. Currently in sys.set_int_max_str_digits()
we are modifying the interpreter's PyConfig directly.
That field should never be modified outside runtime init. Instead, the config value should be copied to a field on PyInterpreterState
and that is what should be modified by sys
(and used in longobject.c).
In fact, this is mostly what we were doing until a couple weeks ago (and what we still are doing in 3.11 and earlier). This was changed on main (3.12) in gh-96944. The fix is relatively trivial.
CC @gpshead