Skip to content

Make sure file object is closed if socket.create_connection fails #11334

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

Merged
merged 1 commit into from
Dec 29, 2018

Conversation

pablogsal
Copy link
Member

If socket.create_connection fails, the second context manager is not initiated and the file is left unclosed.

@pablogsal pablogsal self-assigned this Dec 28, 2018
@asvetlov asvetlov changed the title Make sure file object is close if socket.create_connection fails Make sure file object is closed if socket.create_connection fails Dec 28, 2018
@pablogsal pablogsal merged commit 1f511e1 into python:master Dec 29, 2018
@miss-islington
Copy link
Contributor

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

@pablogsal pablogsal deleted the testWithTimeoutTriggeredSend branch December 29, 2018 01:42
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 29, 2018
…honGH-11334)

The problem affects _testWithTimeoutTriggeredSend in test_socket.py.
(cherry picked from commit 1f511e1)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
@bedevere-bot
Copy link

GH-11350 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 29, 2018
…honGH-11334)

The problem affects _testWithTimeoutTriggeredSend in test_socket.py.
(cherry picked from commit 1f511e1)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
@bedevere-bot
Copy link

GH-11351 is a backport of this pull request to the 3.6 branch.

miss-islington added a commit that referenced this pull request Dec 29, 2018
…11334)

The problem affects _testWithTimeoutTriggeredSend in test_socket.py.
(cherry picked from commit 1f511e1)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
ned-deily pushed a commit that referenced this pull request Jan 18, 2019
…11334) (GH-11351)

The problem affects _testWithTimeoutTriggeredSend in test_socket.py.
(cherry picked from commit 1f511e1)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip issue skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants