mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
GH-125866: Preserve Windows drive letter case in file URIs (#127138)
Stop converting Windows drive letters to uppercase in `urllib.request.pathname2url()` and `url2pathname()`. This behaviour is unnecessary and inconsistent with pathlib's file URI implementation.
This commit is contained in:
parent
a13e94d84b
commit
cc813e10ff
4 changed files with 13 additions and 2 deletions
|
|
@ -1423,6 +1423,7 @@ class Pathname_Tests(unittest.TestCase):
|
|||
self.assertEqual(fn('\\\\?\\unc\\server\\share\\dir'), '//server/share/dir')
|
||||
self.assertEqual(fn("C:"), '///C:')
|
||||
self.assertEqual(fn("C:\\"), '///C:/')
|
||||
self.assertEqual(fn('c:\\a\\b.c'), '///c:/a/b.c')
|
||||
self.assertEqual(fn('C:\\a\\b.c'), '///C:/a/b.c')
|
||||
self.assertEqual(fn('C:\\a\\b.c\\'), '///C:/a/b.c/')
|
||||
self.assertEqual(fn('C:\\a\\\\b.c'), '///C:/a//b.c')
|
||||
|
|
@ -1480,6 +1481,7 @@ class Pathname_Tests(unittest.TestCase):
|
|||
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('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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue