diff options
author | Barney Gale <barney.gale@gmail.com> | 2024-11-12 19:52:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-12 19:52:30 (GMT) |
commit | bf224bd7cef5d24eaff35945ebe7ffe14df7710f (patch) | |
tree | 0fedcebce61343cc6061ad3f0ed53abea8aafc6c /Lib/test/test_urllib.py | |
parent | 7577307ebdaeef6702b639e22a896080e81aae4e (diff) | |
download | cpython-bf224bd7cef5d24eaff35945ebe7ffe14df7710f.zip cpython-bf224bd7cef5d24eaff35945ebe7ffe14df7710f.tar.gz cpython-bf224bd7cef5d24eaff35945ebe7ffe14df7710f.tar.bz2 |
GH-120423: `pathname2url()`: handle forward slashes in Windows paths (#126593)
Adjust `urllib.request.pathname2url()` so that forward slashes in Windows
paths are handled identically to backward slashes.
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r-- | Lib/test/test_urllib.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 28369b2..66e948f 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -1542,6 +1542,11 @@ class Pathname_Tests(unittest.TestCase): self.assertEqual(fn('\\\\some\\share\\'), '//some/share/') self.assertEqual(fn('\\\\some\\share\\a\\b.c'), '//some/share/a/b.c') self.assertEqual(fn('\\\\some\\share\\a\\b%#c\xe9'), '//some/share/a/b%25%23c%C3%A9') + # Alternate path separator + self.assertEqual(fn('C:/a/b.c'), '///C:/a/b.c') + self.assertEqual(fn('//some/share/a/b.c'), '//some/share/a/b.c') + self.assertEqual(fn('//?/C:/dir'), '///C:/dir') + self.assertEqual(fn('//?/unc/server/share/dir'), '//server/share/dir') # Round-tripping urls = ['///C:', '///folder/test/', |