Message227587
Sorry that I did not get involved earlier.
It is difficult to prove any problem with the current behavior and it is rightly closed. The issue which was originally raised seems to me a cosmetic one, which won't get exhibited as well.
Here is simple test case and the output with the current behavior.
# testcases.py
testcases = ["HTTP/1.1 200", "HTTP/1.1 200 OK", "HTTP/1.1 200 ", "HTTP/1.1 200"]
for tc in testcases:
try:
version, status, reason = tc.split(None, 2)
print "%s (%s,%s,%s)" % (tc, version, status, reason)
except ValueError:
version, status = tc.split(None, 1)
print "%s (%s, %s)" % (tc, version, status)
$ python testcases.py
HTTP/1.1 200 (HTTP/1.1, 200)
HTTP/1.1 200 OK (HTTP/1.1,200,OK)
HTTP/1.1 200 (HTTP/1.1, 200 )
HTTP/1.1 200 (HTTP/1.1, 200)
The problem is the status code (str at the moment) has a trailing spaces.
And now, the status code is not used as string. Just after the parsing, the status is converted to integer, Line 337: status = int(status) and rest of urllib and http/client's behavior use status as int rather than as string.
Thanks! |
|
Date |
User |
Action |
Args |
2014-09-26 07:04:11 | orsenthil | set | recipients:
+ orsenthil, pitrou, r.david.murray, karlcow |
2014-09-26 07:04:11 | orsenthil | set | messageid: <1411715051.88.0.336590643527.issue15799@psf.upfronthosting.co.za> |
2014-09-26 07:04:11 | orsenthil | link | issue15799 messages |
2014-09-26 07:04:11 | orsenthil | create | |
|