diff options
Diffstat (limited to 'Lib/urllib')
-rw-r--r-- | Lib/urllib/request.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 3293966..098630e 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -1216,7 +1216,8 @@ class FileHandler(BaseHandler): host, port = splitport(host) if not host or \ (not port and _safe_gethostbyname(host) in self.get_names()): - return addinfourl(open(localfile, 'rb'), headers, 'file:'+file) + return addinfourl(open(localfile, 'rb'), headers, 'file://'+ + host + file) except OSError as msg: # users shouldn't expect OSErrors coming from urlopen() raise URLError(msg) |