mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
GH-127078: url2pathname()
: handle extra slash before UNC drive in URL path (#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.
This commit is contained in:
parent
ebf564a1d3
commit
8c98ed846a
3 changed files with 6 additions and 1 deletions
|
@ -1492,7 +1492,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