]> granicus.if.org Git - python/commitdiff
SF patch #490515 (Joe A) urllib.open_https() protocol issue
authorGuido van Rossum <guido@python.org>
Sat, 8 Dec 2001 17:09:07 +0000 (17:09 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 8 Dec 2001 17:09:07 +0000 (17:09 +0000)
open_http():
    In urllib.py library module, URLopener.open_https()
    returns a class instance of addinfourl() with its
    self.url property missing the protocol.

    Instead of "https://www.someurl.com", it becomes
    "://www.someurl.com".

Lib/urllib.py

index cdb2d0cd3dfb965876510a9bb57a6835726e90cc..2f0f847dbcfe885976b01fa73c6d235deb129dbb 100644 (file)
@@ -373,7 +373,7 @@ class URLopener:
             errcode, errmsg, headers = h.getreply()
             fp = h.getfile()
             if errcode == 200:
-                return addinfourl(fp, headers, url)
+                return addinfourl(fp, headers, "https:" + url)
             else:
                 if data is None:
                     return self.http_error(url, fp, errcode, errmsg, headers)