[issue41705] os.makedirs fails on long-path UNC-paths if it is the first sub-folder

2020-09-03 Thread Eryk Sun


Eryk Sun  added the comment:

This behavior is due to issue 37609, i.e. ntpath.splitdrive fails for "UNC" 
device paths.

>>> ntpath.splitdrive('//?/UNC/server/share')
('//?/UNC', '/server/share')

The result should be "//?/UNC/server/share". A path on the "UNC" device 
requires a share component, on which is mounted a local or remote filesystem 
directory. It's functionally part of the 'drive' path. Using just the root path 
or a server path on the "UNC" device is malformed in the context of a normal 
file API open. The former fails as ERROR_INVALID_NAME (123), and the latter 
fails as ERROR_BAD_PATHNAME (161). 

The incorrect splitdrive result in turn makes ntpath.split misbehave:

>>> ntpath.split('//?/UNC/server/share')
('//?/UNC/server', 'share')
>>> ntpath.split('//?/UNC/server')
('//?/UNC/', 'server')

The correct result should be ('//?/UNC/server/share', '').

--
nosy: +eryksun
type: crash -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41705] os.makedirs fails on long-path UNC-paths if it is the first sub-folder

2020-09-03 Thread Safihre


Change by Safihre :


--
title: os.makedirs fails long-path UNC-paths if it is the first sub-folder -> 
os.makedirs fails on long-path UNC-paths if it is the first sub-folder
type:  -> crash

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com