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
httplib closes socket, then tries to read from it #45689
Comments
I can't get urllib.urlopen() to work with SSL, and it seems to be due to |
I believe this is all that's needed. |
I still think the semantics are wrong here, but someone needs to close |
I don't think that patch is the right thing either. Certainly the |
Is this still relevant? |
Yes. The close is stil in the wrong place. On Nov 21, 2007 2:30 PM, Guido van Rossum <report@bugs.python.org> wrote:
|
The title of this bug is scary. httplib rightly close the socket because that's the way to transfer the The close MUST stays there. I do encounter a bug related to that close while trying to use the ssl I'm willing to help fixing it but *this* bug may not be the right place I'm a bit lost on how to help right now since the involved changes seems |
No, the close must be removed. It's the wrong *way* to "transfer On Nov 25, 2007 3:09 AM, vila <report@bugs.python.org> wrote:
|
Bill, is there a code example that should work but breaks because of |
Well I was confused. In fact, I have a working http/1.1 client which indeed works around that HTTPConnection.close() must be called once the response has been That may be a different problem than the one Bill is after though. I work around it by saving the sock attribute before the call in a class # Preserve our preciousss
sock = self.sock
self.sock = None
# Let httplib.HTTPConnection do its housekeeping
self.close()
# Restore our preciousss
self.sock = sock So not doing the close() is harmless but doing self.sock = None in May be that method should be splitted... |
That's because the socket.py code has been adapted (the first word I wrote On Nov 26, 2007 1:11 PM, Guido van Rossum <report@bugs.python.org> wrote:
|
Is this still relevant? |
No reply to msg114602 so I'll close in a couple of weeks unless anyone objects. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: