[issue8823] urllib2 does not catch httplib.BadStatusLine

Greg Roodt report at bugs.python.org
Sat Jul 7 16:05:59 CEST 2012


Greg Roodt <groodt at gmail.com> added the comment:

I've made a small change to urllib2 to catch the httplib.BadStatusLine and raise as URLError. This exception should rarely happen as it means the server is returning invalid responses. Nevertheless, I've added a test and hopefully fixed the issue.

Patch is attached. I will check if this needs to be added to newer versions of Python.

----------
keywords: +patch
nosy: +groodt
Added file: http://bugs.python.org/file26298/bad_status_urlerror.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8823>
_______________________________________


More information about the Python-bugs-list mailing list