You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've seen this a few times recently. It goes away if you retry:
mypy --platform win32 --python-version 3.8 on the test cases for 'requests': FAILURE
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/tmp/tmps_hms0ww/.venv/lib/python3.11/site-packages/mypy/__main__.py", line 37, in <module>
console_entry()
File "/tmp/tmps_hms0ww/.venv/lib/python3.11/site-packages/mypy/__main__.py", line [15](https://github.com/python/typeshed/actions/runs/7384516395/job/20087616635?pr=11219#step:5:16), in console_entry
main()
File "mypy/main.py", line 100, in main
File "mypy/main.py", line [18](https://github.com/python/typeshed/actions/runs/7384516395/job/20087616635?pr=11219#step:5:19)2, in run_build
File "mypy/build.py", line [19](https://github.com/python/typeshed/actions/runs/7384516395/job/20087616635?pr=11219#step:5:20)1, in build
File "mypy/build.py", line 265, in _build
File "mypy/build.py", line 2943, in dispatch
File "mypy/build.py", line 3334, in process_graph
File "mypy/build.py", line 3415, in process_fresh_modules
File "mypy/build.py", line [21](https://github.com/python/typeshed/actions/runs/7384516395/job/20087616635?pr=11219#step:5:22)11, in fix_cross_refs
File "mypy/fixup.py", line 52, in fixup_module
File "mypy/fixup.py", line 1[27](https://github.com/python/typeshed/actions/runs/7384516395/job/20087616635?pr=11219#step:5:28), in visit_symbol_table
File "mypy/lookup.py", line [31](https://github.com/python/typeshed/actions/runs/7384516395/job/20087616635?pr=11219#step:5:32), in lookup_fully_qualified
AssertionError: Cannot find module for resource.struct_rusage
I was thinking about moving the struct into its own internal module to reduce the import cycle. (Fixing mypy would be the best course of action, although that could be hard with a non-reproducible bug.)
Activity
AlexWaygood commentedon Jan 2, 2024
The traceback always seems to mention
resource.struct_rusage, so I'm guessing it must be related to 3edfd90. But I have no idea:regr_test.py, not on runs ofmypy_test.pyorstubtest_stdlib.pyAlexWaygood commentedon Jan 7, 2024
I managed to repro this locally, though I had to run
python tests/regr_test.py --all4 times in a row before I hit theAssertionError.Disable regression tests temporarily
hauntsaninja commentedon Jan 16, 2024
I ran it thirty times on my Mac laptop without a repro :-/ I'll try on a Linux machine tomorrow
Assuming it's related to that commit, I almost wonder if something dumb like moving the import into the same clause would fix...
srittau commentedon Jan 16, 2024
I was thinking about moving the struct into its own internal module to reduce the import cycle. (Fixing mypy would be the best course of action, although that could be hard with a non-reproducible bug.)
AlexWaygood commentedon Jan 29, 2024
Hmmm... this feels like #10714 (comment)... I wonder...
Edit: no, that doesn't seem to be it. Switching to use a
ProcessPoolExecutorlocally doesn't fix the crash.AlexWaygood commentedon Jan 30, 2024
This is the tiny script I'm using to repro the crash, FWIW. It generally occurs for me within the first three iterations:
hauntsaninja commentedon Jan 30, 2024
Thanks for following up! Still not able to reproduce on Mac, but was able to reproduce on Linux.
Move resource.struct_rusage import
Limit regression test workers to 1