mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
Issue #23146: Fix mishandling of absolute Windows paths with forward slashes in pathlib.
Detected and fixed by Serhiy.
This commit is contained in:
parent
0aa74e10bb
commit
57fffd6f99
3 changed files with 27 additions and 16 deletions
|
@ -73,6 +73,10 @@ class _Flavour(object):
|
|||
# parts. This makes the result of parsing e.g.
|
||||
# ("C:", "/", "a") reasonably intuitive.
|
||||
for part in it:
|
||||
if not part:
|
||||
continue
|
||||
if altsep:
|
||||
part = part.replace(altsep, sep)
|
||||
drv = self.splitroot(part)[0]
|
||||
if drv:
|
||||
break
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue