Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b931bf3

Browse files
committed
SF patch #490515 (Joe A) urllib.open_https() protocol issue
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".
1 parent 1f1e727 commit b931bf3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/urllib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def open_https(self, url, data=None):
373373
errcode, errmsg, headers = h.getreply()
374374
fp = h.getfile()
375375
if errcode == 200:
376-
return addinfourl(fp, headers, url)
376+
return addinfourl(fp, headers, "https:" + url)
377377
else:
378378
if data is None:
379379
return self.http_error(url, fp, errcode, errmsg, headers)

0 commit comments

Comments
 (0)