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
SSLObject breaks read semantics #42372
Comments
f = socket.ssl(sock)
f.read(n) doesn't always return n bytes, even if the connection We've had to work around this with code like the following: pieces = []
while n > 0:
got = self.realfile.read(n)
if not got:
break
pieces.append(got)
n -= len(got)
return ''.join(pieces) |
I think I'm going to close this. file.read(N) is not guaranteed to |
This is incorrect. Perhaps you are thinking of a raw socket read; a |
s/raw socket read/raw socket recv/ |
The way I read the documentation, file.read() (and that's what we're However, the "read" method on an SSLSocket, which is not a file() |
Here is the exact SSLObject.read documentation from 2.5 (although the ----- read([n]) If n is provided, read n bytes from the SSL connection, otherwise read ----- This is not ambiguous. Similarly, help(file.read) is not ambiguous. If you want to claim "well, it's not a file-like object" then (a) it (Obviously socket.makefile won't work on an object that doesn't |
Ah, sorry. I was looking at the 2.6 documentation, not the 2.5 If you'd like to submit a patch for 2.5 and 2.6, I think this is |
Ah, great. I was wondering why you kept talking about SSLSocket |
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: