diff options
| author | Dong-hee Na <donghee.na92@gmail.com> | 2018-06-12 23:30:45 +0900 |
|---|---|---|
| committer | Ćukasz Langa <lukasz@langa.pl> | 2020-08-27 02:24:38 +0200 |
| commit | 94ad6c674f7687ef22853cb8d42b440d6b42ddc8 (patch) | |
| tree | 7e5c3858a3178adf6c1353f95611402a92c893a6 /Lib/pathlib.py | |
| parent | 82e79480d6e61940d7007d9026fbff0b1a11ad9a (diff) | |
| download | cpython-git-94ad6c674f7687ef22853cb8d42b440d6b42ddc8.tar.gz | |
bpo-33660: Fix PosixPath to resolve a relative path on root
Diffstat (limited to 'Lib/pathlib.py')
| -rw-r--r-- | Lib/pathlib.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 9f5e27b911..babc443dd3 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -329,7 +329,10 @@ class _PosixFlavour(_Flavour): # parent dir path, _, _ = path.rpartition(sep) continue - newpath = path + sep + name + if path.endswith(sep): + newpath = path + name + else: + newpath = path + sep + name if newpath in seen: # Already seen this path path = seen[newpath] |
