-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Accessing the Token.MISSING
class var from the contextvars
module within a subinterpreter raises an AttributeError
. E.g. the following script:
import contextvars
from concurrent.interpreters import create, get_current
print(get_current(), contextvars.Token, getattr(contextvars.Token, "MISSING", None))
ip1 = create()
ip1.exec("""
import contextvars
from concurrent.interpreters import get_current
print(get_current(), contextvars.Token, getattr(contextvars.Token, "MISSING", "'doesn't exist'"))
""")
outputs
Interpreter(0) <class '_contextvars.Token'> <Token.MISSING>
Interpreter(1) <class '_contextvars.Token'> 'doesn't exist'
CPython versions tested on:
3.14
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-subinterpreterstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done