-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
bpo-38031: Fix a possible assertion failure in _io.FileIO() #15688
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
bpo-38031: Fix a possible assertion failure in _io.FileIO() #15688
Conversation
Use PyErr_Fetch() / _PyErr_ChainExceptions() when calling internal_close() on error. The opener may return an invalid fd, which will cause the close() call in internal_close() to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @ZackerySpytz.
The macOS failures in Azure may be related to https://bugs.python.org/issue37245 and not related to this PR. (Build log: https://dev.azure.com/Python/cpython/_build/results?buildId=49868&view=logs&j=18d1a34d-6940-5fc1-f55b-405e2fba32b1)
2 tests failed: test_functools test_multiprocessing_spawn
Both of the above tests timed out.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTH. Just address Victor's comment.
|
@ZackerySpytz, please address the code review. Thanks! |
iritkatriel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converted @vstinner's comment into suggestions.
vstinner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for updating the PR @iritkatriel ;-)
|
Thanks @ZackerySpytz for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Use PyErr_Fetch() / _PyErr_ChainExceptions() when calling
internal_close() on error. The opener may return an invalid
fd, which will cause the close() call in internal_close() to fail.
https://bugs.python.org/issue38031