- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 33.3k
 
Open
Labels
3.12only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
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
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error