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
Replace Py_FatalError() with regular Python exceptions #82812
Comments
I replaced dozens of Py_FatalError() calls with better error reporting, but there are still many places calling Py_FatalError(). The problem of Py_FatalError() is when Python is embedded into an application: Python must not kill the whole process. Well, even in the "regular" Python (/usr/bin/python3), Python should not exit immediately on an error. For example, the readline module calls Py_FatalError() on memory allocation failure, whereas PyErr_NoMemory() could be used: PyErr_NoMemory() should work since it should not allocate memory. |
FWIW, I agree. :) |
(I have a few more functions that I would like to patch, so I keep the issue open as place holder.) |
There are still around 122 calls to Py_FatalError() in the master branch. But remaining ones are the hardest to remove. I close the issue, it's already better than previously. Compare this number to 285 calls in Python 3.6. |
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: