builtins.__spec__ seems to be missing on 3.9
I'm not sure whether this is an actual bug or whether I don't understand an implementation detail that changed between 3.8 and 3.9. Anyway, here goes:
With the following file:
import sys
print(sys.modules["builtins"].__spec__)
I get the following results for different CPython and PyPy versions:
❯ python --version
Python 3.8.12
❯ python test.py
ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>)
❯ python --version
Python 3.9.6
❯ python test.py
ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in')
❯ python --version
Python 3.8.12 (9ef55f6fc369, Oct 25 2021, 05:10:01)
[PyPy 7.3.7 with GCC Apple LLVM 13.0.0 (clang-1300.0.29.3)]
❯ python test.py
ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in')
❯ python --version
Python 3.9.12 (05fbe3aa5b0845e6c37239768aa455451aa5faba, Mar 29 2022, 09:54:47)
[PyPy 7.3.9 with GCC Apple LLVM 13.0.0 (clang-1300.0.29.30)]
❯ python test.py
None
There is a slight difference in patch versions for 3.9
, but I don't think this should influence the behaviour. My question is, is there a reason why __spec__
is missing on the builtins
module on 3.9
?
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information