From d4befde7c5185fd6e974b883df63c02bf372df38 Mon Sep 17 00:00:00 2001 From: barneygale Date: Tue, 29 Oct 2024 23:14:29 +0000 Subject: [PATCH] Windows test fixes #4 --- Lib/test/test_urllib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 958fd06725a56b..16aa1751b09203 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -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, @@ -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')