-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-importlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Module pyclbr cannot browse a file named __main__
because it cannot get the spec.
>>> from importlib import util
>>> util._find_spec_from_path('__init__')
ModuleSpec(name='__init__', loader=<_frozen_importlib_external.SourceFileLoader object at 0x000001C6C2462DB0>, origin='C:\\Programs\\Python313\\Lib\\idlelib\\__init__.py')
>>> util._find_spec_from_path('__main__')
Traceback (most recent call last):
File "<pyshell#14>", line 1, in <module>
util._find_spec_from_path('__main__')
File "<frozen importlib.util>", line 67, in _find_spec_from_path
ValueError: __main__.__spec__ is None
This is 3.13.0a5 but same in prior versions.
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-importlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error