def test_file_notexists(self):
fd, tmp_file = tempfile.mkstemp()
- tmp_fileurl = 'file://' + tmp_file
+ tmp_fileurl = 'file://localhost' + tmp_file
self.assertTrue(os.path.exists(tmp_file))
self.assertTrue(urlopen(tmp_fileurl))
return addinfourl(open(localname, 'rb'), headers, urlfile)
host, port = splitport(host)
if (not port
- and socket.gethostbyname(host) in (localhost() + thishost())):
+ and socket.gethostbyname(host) in ((localhost(),) + thishost())):
urlfile = file
if file[:1] == '/':
urlfile = 'file://' + file
Library
-------
+- Issue #16301: Fix the localhost verification in urllib/request.py for file://
+ urls.
+
- Issue #16250: Fix the invocations of URLError which had misplaced filename
attribute for exception.