Eryk Sun <eryk...@gmail.com> added the comment:

RFC8089 doesn't specify "a mechanism for translating namespaced paths ["\\?\" 
and "\\.\"] to or from file URIs", and the Windows shell doesn't support them. 
So what's the practical benefit of supporting them in nturl2path?

> Windows file paths are limited to 256 characters,

Classically, normal filepaths are limited to MAX_PATH - 1 (259) characters, in 
most cases, except for a few cases in which the limit is even smaller. 

For a normal filepath, the API replaces slashes with backlashes; resolves 
relative paths; resolves "." and ".." components; strips trailing dots and 
spaces from the final path component; and, for relative paths and DOS 
drive-letter paths, reserves DOS device names in the final path component (e.g. 
CON, NUL). 

The kernel supports filepaths with up to 32,767 characters, but classically 
this was only accessible by using a verbatim \\?\ filepath, or by using 
workarounds based on substitute drives or filesystem mountpoints and symlinks.

With Python 3.6+ in Windows 10, if long paths are enabled in the system, normal 
filepaths support up to the full 32,767 characters in most cases. The need for 
the \\?\ prefix is thus limited to the rare case when a verbatim path is 
required, or when a filepath has to be passed to a legacy application that 
doesn't support long paths.

----------
nosy: +eryksun

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43607>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to