Closed
Description
ntpath.join()
incorrectly inserts an additional slash when joining an argument onto an incomplete UNC drive with a trailing slash:
>>> import ntpath
>>> ntpath.join('\\\\server\\share\\foo\\', 'bar')
'\\\\server\\share\\foo\\bar' # ok
>>> ntpath.join('\\\\server\\share\\', 'foo')
'\\\\server\\share\\foo' # ok
>>> ntpath.join('\\\\server\\', 'share')
'\\\\server\\\\share' # wrong!
>>> ntpath.join('\\\\', 'server')
'\\\\\\server' # wrong!
Before 005e694 (3.12), the last test case succeeds because splitdrive()
doesn't identify '\\\\'
as a UNC drive. But the third test case is reproducible going back to 3.11 and 3.10.