Skip to content

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

Merged
vstinner merged 1 commit into
python:3.6from
nirs:bpo-30980-3.6
Jul 26, 2017
Merged

[3.6] bpo-30980: Fix double close in asyncore.file_wrapper#2898
vstinner merged 1 commit into
python:3.6from
nirs:bpo-30980-3.6

Conversation

@nirs
Copy link
Copy Markdown
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
Copy Markdown
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 October 1, 2022 22:17
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.

3 participants