*** urllibhead.py --- urllib.py *************** *** 435,441 **** # something went wrong with the HTTP status line raise IOError, ('http protocol error', 0, 'got a bad status line', None) ! if errcode == 200: return addinfourl(fp, headers, "https:" + url) else: if data is None: --- 435,443 ---- # something went wrong with the HTTP status line raise IOError, ('http protocol error', 0, 'got a bad status line', None) ! # According to RFC 2616, "2xx" code indicates that the client's ! # request was successfully received, understood, and accepted. ! if not (200 <= errcode < 300): return addinfourl(fp, headers, "https:" + url) else: if data is None: