Skip to content
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

[3.6] bpo-30980: Fix double close in asyncore.file_wrapper #2898

Merged
merged 1 commit into from Jul 26, 2017

Conversation

nirs
Copy link
Contributor

@nirs nirs commented Jul 26, 2017

test_close_twice was not considering the fact that file_wrapper is
duping the file descriptor. Closing the original descriptor left the
duped one open, hiding the fact that close protection is not effective.

Invalidated self.fd before closing, handling correctly the case when
os.close raises.

  • bpo-30980: Fix fd leak introduced in the fixed test

https://bugs.python.org/issue30980

* bpo-30980: Fix close test to fail

test_close_twice was not considering the fact that file_wrapper is
duping the file descriptor. Closing the original descriptor left the
duped one open, hiding the fact that close protection is not effective.

* bpo-30980: Fix double close protection

Invalidated self.fd before closing, handling correctly the case when
os.close raises.

* bpo-30980: Fix fd leak introduced in the fixed test
@nirs
Copy link
Contributor Author

nirs commented Jul 26, 2017

@Haypo, @giampaolo please review.

@vstinner vstinner merged commit 25de5ba into python:3.6 Jul 26, 2017
@nirs nirs deleted the bpo-30980-3.6 branch Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants