Skip to content

Commit

Permalink
Windows test fixes python#4
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Oct 29, 2024
1 parent 73c8bcf commit d4befde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/test/test_urllib.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def constructLocalFileUrl(self, filePath):
filePath.encode("utf-8")
except UnicodeEncodeError:
raise unittest.SkipTest("filePath is not encodable to utf8")
return "file://%s" % urllib.request.pathname2url(filePath)
return urllib.request.pathname2url(filePath, include_scheme=True)

def createNewTempFile(self, data=b""):
"""Creates a new temporary file containing the specified data,
Expand Down Expand Up @@ -1569,7 +1569,7 @@ def test_url2pathname_win(self):
self.assertEqual(fn("///C/test/"), '\\C\\test\\')
self.assertEqual(fn("////C/test/"), '\\\\C\\test\\')
# DOS drive paths
self.assertEqual(fn('C:/path/to/file'), 'C:\\path\\to\\file')
self.assertEqual(fn('file:C:/path/to/file'), 'C:\\path\\to\\file')
self.assertEqual(fn('C|/path/to/file'), 'C:\\path\\to\\file')
self.assertEqual(fn('/C|/path/to/file'), 'C:\\path\\to\\file')
self.assertEqual(fn('///C|/path/to/file'), 'C:\\path\\to\\file')
Expand Down

0 comments on commit d4befde

Please sign in to comment.