Senthil Kumaran added the comment: 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! ---------- type: enhancement -> behavior _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15799> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com