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
infinite loop in PyRun_InteractiveLoopFlags() #74881
Comments
To reproduce the problem, apply the nomemory_allocator.patch from issue 30695 and run the following two statements that must be interrupted with ^C:
$ ./python -q
>>> import _testcapi
>>> _testcapi.set_nomemory_allocator()
sys.excepthook is missing
^Cpython: Objects/call.c:785: PyEval_CallObjectWithKeywords: Assertion `!PyErr_Occurred()' failed.
Aborted (core dumped) The attached patch fixes this problem. |
The patch is far too simplistic. With this patch an exception kills the interactive loop, for example: $ ./python -q
>>> x
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'x' is not defined
$ |
See also my old issue bpo-8070 opened 7 years ago :-) |
Thanks for fixing this very old bug! What about Python 2.7? |
_testcapi.set_nomemory() does not exist on Pyhton 2.7 so the changes cannot be tested. Applying the changes to PyRun_InteractiveLoopFlags() in 2.7 looks rather straightforward but there are too many differences in PyRun_InteractiveOneFlags() between 2.7 and 3.7. |
Also the existing test coverage of these functions in all the Python versions is very weak. |
Ok, I understand, thanks for the explanation. |
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: