Issue #23146: Fix mishandling of absolute Windows paths with forward slashes in pathlib.

Detected and fixed by Serhiy.
This commit is contained in:
Antoine Pitrou 2015-02-15 18:03:59 +01:00
parent 0aa74e10bb
commit 57fffd6f99
3 changed files with 27 additions and 16 deletions

View file

@ -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