This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author orsenthil
Recipients karlcow, orsenthil, pitrou, r.david.murray
Date 2014-09-26.07:04:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411715051.88.0.336590643527.issue15799@psf.upfronthosting.co.za>
In-reply-to
Content
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!
History
Date User Action Args
2014-09-26 07:04:11orsenthilsetrecipients: + orsenthil, pitrou, r.david.murray, karlcow
2014-09-26 07:04:11orsenthilsetmessageid: <1411715051.88.0.336590643527.issue15799@psf.upfronthosting.co.za>
2014-09-26 07:04:11orsenthillinkissue15799 messages
2014-09-26 07:04:11orsenthilcreate