-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
topic-C-APItopic-importlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
import sys
import json
print(json) # <module 'json'>
print(sys.modules["json"]) # <module 'json'>
import ctypes
print(ctypes.pythonapi.PyImport_ImportModule(ctypes.c_char_p(b"json"))) # 2356734321
sys.modules = sys.modules.copy()
import email
print(email) # <module 'email'>
print(sys.modules["email"]) # <module 'email'>
print(ctypes.pythonapi.PyImport_ImportModule(ctypes.c_char_p(b"email"))) # KeyError: 'email'
CPython versions tested on:
3.12, 3.13
Operating systems tested on:
No response
Metadata
Metadata
Assignees
Labels
topic-C-APItopic-importlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error