GH-103220: Fix ntpath.join() of partial UNC drive with trailing slash (GH-103221)

This commit is contained in:
Barney Gale 2023-04-11 17:26:45 +01:00 committed by GitHub
parent 50b4b15984
commit b57105ae33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View file

@ -142,7 +142,7 @@ def join(path, *paths):
result_path = result_path + p_path
## add separator between UNC and non-absolute path
if (result_path and not result_root and
result_drive and result_drive[-1:] != colon):
result_drive and result_drive[-1:] not in colon + seps):
return result_drive + sep + result_path
return result_drive + result_root + result_path
except (TypeError, AttributeError, BytesWarning):