summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-11-24 17:30:29 (GMT)
committerGitHub <noreply@github.com>2024-11-24 17:30:29 (GMT)
commit97b2ceaaaf88a73a45254912a0e972412879ccbf (patch)
tree0d103bb0bf447a581c49142da72c8293f87394fb /Lib/test
parent2bb7846cacb342246aada5ed92d323e54c946063 (diff)
downloadcpython-97b2ceaaaf88a73a45254912a0e972412879ccbf.zip
cpython-97b2ceaaaf88a73a45254912a0e972412879ccbf.tar.gz
cpython-97b2ceaaaf88a73a45254912a0e972412879ccbf.tar.bz2
gh-127217: Fix pathname2url() for paths starting with multiple slashes on Posix (GH-127218)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_urllib.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index 22ef3c6..fe16bad 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -1458,6 +1458,9 @@ class Pathname_Tests(unittest.TestCase):
fn = urllib.request.pathname2url
self.assertEqual(fn('/'), '/')
self.assertEqual(fn('/a/b.c'), '/a/b.c')
+ self.assertEqual(fn('//a/b.c'), '////a/b.c')
+ self.assertEqual(fn('///a/b.c'), '/////a/b.c')
+ self.assertEqual(fn('////a/b.c'), '//////a/b.c')
self.assertEqual(fn('/a/b%#c'), '/a/b%25%23c')
@unittest.skipUnless(os_helper.FS_NONASCII, 'need os_helper.FS_NONASCII')