Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Lib/test/test_urllib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,14 +850,16 @@ def test_file(self):
self.assertEqual(headers["Last-modified"], modified)
self.assertEqual(respurl, canonurl)

_, cwd = os.path.splitdrive(os.getcwd())
cwd = cwd.replace("\\", "/")
for url in [
parsed._replace(netloc='localhost:80').geturl(),
"file:///file_does_not_exist.txt",
"file://not-a-local-host.com//dir/file.txt",
"file://%s:80%s/%s" % (socket.gethostbyname('localhost'),
os.getcwd(), TESTFN),
cwd, TESTFN),
"file://somerandomhost.ontheinternet.com%s/%s" %
(os.getcwd(), TESTFN),
(cwd, TESTFN),
]:
try:
f = open(TESTFN, "wb")
Expand Down
Loading