bpo-38031: Fix a possible assertion failure in _io.FileIO()#15688
bpo-38031: Fix a possible assertion failure in _io.FileIO()#15688iritkatriel merged 12 commits intopython:mainfrom
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.
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.
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.
Converted @vstinner's comment into suggestions.
vstinner
left a comment
There was a problem hiding this comment.
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