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

1423443: Handle IndexError during m2crypto request #1556

Merged
merged 1 commit into from Mar 10, 2017
Merged

Conversation

kahowell
Copy link
Contributor

@kahowell kahowell commented Mar 3, 2017

Looks like this happens because the httplib code that handles
socket.error expects socket.error to be in a certain state. I'm guessing
this occurs when the socket.error raised is initialized with a string,
rather than a code and string.

Anyways, this will handle the case specially by having the m2crypto
wrapper detect IndexError explicitly, and raise a socket.error. Even
though there's a risk that the IndexError is raised internally for some
other reason, it seems harmless to simply map any IndexError encountered
in an m2crypto request to a socket.error.

Looks like this happens because the httplib code that handles
socket.error expects socket.error to be in a certain state. I'm guessing
this occurs when the socket.error raised is initialized with a string,
rather than a code and string.

Anyways, this will handle the case specially by having the m2crypto
wrapper detect IndexError explicitly, and raise a socket.error. Even
though there's a risk that the IndexError is raised internally for some
other reason, it seems harmless to simply map any IndexError encountered
in an m2crypto request to a socket.error.
@kahowell
Copy link
Contributor Author

kahowell commented Mar 3, 2017

7229583..7015d77: Skip m2crypto test if we're testing with Python3

@wottop wottop self-assigned this Mar 10, 2017
@wottop
Copy link
Member

wottop commented Mar 10, 2017

ack

@wottop wottop merged commit 8f73a6c into master Mar 10, 2017
@wottop wottop deleted the khowell/1423443 branch March 10, 2017 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants