-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_site fails if run after test_inspect #79052
Comments
$ ./python -m test.regrtest test_inspect test_site
Run tests sequentially
0:00:00 load avg: 0.03 [1/2] test_inspect
0:00:00 load avg: 0.03 [2/2] test_site
test test_site failed -- Traceback (most recent call last):
File "/home/yen/Projects/cpython/Lib/test/test_site.py", line 400, in test_abs_paths_cached_None
site.abs_paths()
File "/home/yen/Projects/cpython/Lib/site.py", line 101, in abs_paths
for m in set(sys.modules.values()):
TypeError: unhashable type: 'dict'
If I run test_inspect or test_site individually, both pass. Full log can be found in the attached file. Environment: Arch Linux x86_64 latest. CPython commit 81574b8, configured with |
You can try to limit the number of tests needed to reproduce the bug using: ./python -m test.bisect -n 5 test_inspect test_site |
The failing test was added with d4c76d9 commit d4c76d9
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py + def test_abs_paths_cached_None(self): # Latest master ➜ cpython git:(master) ./python.exe -m test.regrtest test_inspect test_site
Run tests sequentially
0:00:00 load avg: 1.75 [1/2] test_inspect
0:00:02 load avg: 1.75 [2/2] test_site
test test_site failed -- Traceback (most recent call last):
File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_site.py", line 400, in test_abs_paths_cached_None
site.abs_paths()
File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/site.py", line 101, in abs_paths
for m in set(sys.modules.values()):
TypeError: unhashable type: 'dict' test_site failed == Tests result: FAILURE == 1 test OK. 1 test failed: Total duration: 2 sec 868 ms ➜ cpython git:(master) git checkout d4c76d9~1 Lib/test/test_site.py == Tests result: SUCCESS == All 2 tests OK. Total duration: 2 sec 848 ms Adding INADA Naoki for thoughts. Thanks |
Thanks very much for the test.bisect hint! After some more trials, I guess it's an issue in the import inspect
import sys
import _testcapi
builtin = _testcapi.docstring_with_signature_with_defaults
spec = inspect.getfullargspec(builtin)
print(type(sys.modules['__builtins__'])) After inspect.getfullargspec(), sys.modules['__builtins__'] is a dict. That's a little bit strange as every other item in sys.modules is a module. |
Thank you Inada-san for taking care of this. |
./python -m test.regrtest -v test_inspect test_site
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: