diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2015-02-15 17:03:59 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2015-02-15 17:03:59 (GMT) |
commit | 57fffd6f99d55ccd623b381622b989410a695b99 (patch) | |
tree | e7496d2dd553e3843195302918b6cb874eb25704 /Lib/pathlib.py | |
parent | 0aa74e10bb7697db00514d62269ff9cae7bd7af9 (diff) | |
download | cpython-57fffd6f99d55ccd623b381622b989410a695b99.zip cpython-57fffd6f99d55ccd623b381622b989410a695b99.tar.gz cpython-57fffd6f99d55ccd623b381622b989410a695b99.tar.bz2 |
Issue #23146: Fix mishandling of absolute Windows paths with forward slashes in pathlib.
Detected and fixed by Serhiy.
Diffstat (limited to 'Lib/pathlib.py')
-rw-r--r-- | Lib/pathlib.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 73fd432..918ac8d 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -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 |