Commit 3d7e1152 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #19911: ntpath.splitdrive() now correctly processes the 'İ' character

(U+0130, LATIN CAPITAL LETTER I WITH DOT ABOVE).
parent 8a1d1e64
...@@ -207,7 +207,7 @@ def splitdrive(p): ...@@ -207,7 +207,7 @@ def splitdrive(p):
empty = _get_empty(p) empty = _get_empty(p)
if len(p) > 1: if len(p) > 1:
sep = _get_sep(p) sep = _get_sep(p)
normp = normcase(p) normp = p.replace(_get_altsep(p), sep)
if (normp[0:2] == sep*2) and (normp[2:3] != sep): if (normp[0:2] == sep*2) and (normp[2:3] != sep):
# is a UNC path: # is a UNC path:
# vvvvvvvvvvvvvvvvvvvv drive letter or UNC path # vvvvvvvvvvvvvvvvvvvv drive letter or UNC path
......
...@@ -66,6 +66,9 @@ class TestNtpath(unittest.TestCase): ...@@ -66,6 +66,9 @@ class TestNtpath(unittest.TestCase):
('', '\\\\conky\\\\mountpoint\\foo\\bar')) ('', '\\\\conky\\\\mountpoint\\foo\\bar'))
tester('ntpath.splitdrive("//conky//mountpoint/foo/bar")', tester('ntpath.splitdrive("//conky//mountpoint/foo/bar")',
('', '//conky//mountpoint/foo/bar')) ('', '//conky//mountpoint/foo/bar'))
# Issue #19911: UNC part containing U+0130
self.assertEqual(ntpath.splitdrive('//conky/MOUNTPOİNT/foo/bar'),
('//conky/MOUNTPOİNT', '/foo/bar'))
def test_split(self): def test_split(self):
tester('ntpath.split("c:\\foo\\bar")', ('c:\\foo', 'bar')) tester('ntpath.split("c:\\foo\\bar")', ('c:\\foo', 'bar'))
......
...@@ -29,6 +29,9 @@ Core and Builtins ...@@ -29,6 +29,9 @@ Core and Builtins
Library Library
------- -------
- Issue #19911: ntpath.splitdrive() now correctly processes the 'İ' character
(U+0130, LATIN CAPITAL LETTER I WITH DOT ABOVE).
- Issue #19532: python -m compileall with no filename/directory arguments now - Issue #19532: python -m compileall with no filename/directory arguments now
respects the -f and -q flags instead of ignoring them. respects the -f and -q flags instead of ignoring them.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment