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
Reader of BufferedRWPair is not closed if writer's close() fails #66001
Comments
Current implementation of BufferedRWPair.close() is: def close(self):
self.writer.close()
self.reader.close() When self.writer.close() raises an exception, self.reader left non-closed. This can cause file description leak unless GC sweep it. Proposed patch fixes this issue. With applied patch for bpo-21715 it would be a little simpler. |
Antoine, what do you think about this? |
Why don't you reuse the API from bpo-21715? |
Because this API was not still committed. Here is a patch which uses it. |
Ping. If this patch will be accepted I'll provide larger patch for similar issues in close methods of other classes. |
New changeset d4694c672c36 by Serhiy Storchaka in branch '3.4': New changeset f515c7ccff57 by Serhiy Storchaka in branch 'default': New changeset dcf25060cae8 by Serhiy Storchaka in branch '2.7': |
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: