mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
[3.12] GH-127078: url2pathname()
: handle extra slash before UNC drive in URL path (GH-127132) (#127136)
GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path (GH-127132)
Decode a file URI like `file://///server/share` as a UNC path like
`\\server\share`. This form of file URI is created by software the simply
prepends `file:///` to any absolute Windows path.
(cherry picked from commit 8c98ed846a
)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
This commit is contained in:
parent
4b705f50d1
commit
c470e822bf
3 changed files with 6 additions and 1 deletions
|
@ -1600,7 +1600,7 @@ class Pathname_Tests(unittest.TestCase):
|
|||
# UNC paths
|
||||
self.assertEqual(fn('//server/path/to/file'), '\\\\server\\path\\to\\file')
|
||||
self.assertEqual(fn('////server/path/to/file'), '\\\\server\\path\\to\\file')
|
||||
self.assertEqual(fn('/////server/path/to/file'), '\\\\\\server\\path\\to\\file')
|
||||
self.assertEqual(fn('/////server/path/to/file'), '\\\\server\\path\\to\\file')
|
||||
# Localhost paths
|
||||
self.assertEqual(fn('//localhost/C:/path/to/file'), 'C:\\path\\to\\file')
|
||||
self.assertEqual(fn('//localhost/C|/path/to/file'), 'C:\\path\\to\\file')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue