-
Notifications
You must be signed in to change notification settings - Fork 93
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
Recursion Crashes Under Windows in Python 3.12 and 3.13 #1096
Comments
I have seen a somewhat similar behavior with #1086, but labeled it as a limitation due to another context. I did not really understand the cause of the problem (it has to do with the virtual environment and the Python path, but I was not able to find a good solution to prevent this). An easy workaround to fix this is to use |
Yes, running it as |
@MikeTheHammer - I added a workaround that should mitigate the issue. Can you please check if the main branch works for you? |
I've made a new patch release with the workaround. I'm not happy with the solution and will try to understand the underlying issue better, but I'm closing this issue for now. Please re-open if the issue persists with the current version. |
@mrbean-bremen
Please notice, the upper case letters for 'EXE' which prevents your workaround to actually work in this scenario. Patching (locally) the workaround line # workaround for updatecache problem with pytest under Windows, see #1096
if not filename.endswith(r"pytest.exe\__main__.py"):
return self.linecache_updatecache(filename, module_globals)
return [] to # workaround for updatecache problem with pytest under Windows, see #1096
if not filename.endswith(r"pytest.exe\__main__.py") and not filename.endswith(r"pytest.EXE\__main__.py"):
return self.linecache_updatecache(filename, module_globals)
return [] ultimately fixed it for me as well (I assume there are more elegant ways to accomplish this - I just wanted to proof my point). Since I couldn't re-open this issue, I just wanted to let you know that the workaround could be improved. Until then, we are going to call pytest by |
Thanks - that makes total sense. We should have just ignored the capitalization, given that Windows is not case-sensitive. |
Thank you |
- ignore the pytest executable capitalization - fixes pytest-dev#1096 (again)
I couldn't think of a test for this, but as it is a very trivial change I think we can live with this. |
Discussed in #1095
Originally posted by MikeTheHammer December 3, 2024
I think this is a bug, but it might be something I'm doing wrong.
I've run the following smoke test under Linux (Ubuntu 24.04) and Windows 10 LTSC, using Pythons 3.9 - 3.13 .
Under Linux, this test passes on all Pythons 3.9 - 3.13. Under Windows, it passes on 3.9 - 3.11, but crashes with a
RecursionError: maximum recursion depth exceeded
on Python 3.12 and 3.13.On Python 3.12, the stack trace is:
That error repeats 74 times, followed by:
The stack trace in 3.13 is similar:
This is repeated 60 times, followed by:
Versions:
pytest 8.3.4
pyfakefs 5.7.2
Linux Ubuntu 24.04 - Linux 6.8.0-49-generic x86_64:
Windows 10 LTSC 21H2 (OS Build 19044.5131) :
The text was updated successfully, but these errors were encountered: