bpo-33660: Fix PosixPath to resolve a relative path on root (#21974)

(cherry picked from commit 94ad6c674f)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
This commit is contained in:
Miss Islington (bot) 2020-08-26 17:51:44 -07:00 committed by GitHub
parent 9de6be4e2a
commit 211e4c6e9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View file

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