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

catch socket.error in utils.localinterfaces #3354

Merged
merged 1 commit into from May 23, 2013

Conversation

minrk
Copy link
Member

@minrk minrk commented May 23, 2013

instead of socket.gaierror, which is a more specific subclass. Some failures
(e.g. connection timeouts) are not gaierrors.

Alternately, we might want to just catch any Exception.

instead of socket.gaierror, which is a more specific subclass.
Some failures (e.g. connection timeouts) are not gaierrors.

Alternately, we might want to just catch any Exception.
@fperez
Copy link
Member

fperez commented May 23, 2013

Great, fixes the problem. Thanks! Merging now.

fperez added a commit that referenced this pull request May 23, 2013
catch socket.error in utils.localinterfaces, instead of socket.gaierror, which is a more specific subclass.  

This protects against certain failures seen on Ubuntu 13.04 but which could conceivably happen elsewhere.
@fperez fperez merged commit 840b829 into ipython:master May 23, 2013
@minrk
Copy link
Member Author

minrk commented May 23, 2013

mro shows that our choices, in descending specificity are:

socket.error
IOError
Exception

Depending on how certain we want to be that the import never fails. Exception would be safest, but might be annoying because it would hide things like NameErrors on typos.

@fperez
Copy link
Member

fperez commented May 23, 2013

I think this is fine, we should only broaden this based on evidence that it's too narrow. I found evidence that gaierror was too specific, let's stick with socket.error for now...

@minrk minrk deleted the socket.error branch March 31, 2014 23:36
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
catch socket.error in utils.localinterfaces, instead of socket.gaierror, which is a more specific subclass.  

This protects against certain failures seen on Ubuntu 13.04 but which could conceivably happen elsewhere.
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

2 participants