STINNER Victor <vstin...@redhat.com> added the comment:

subprocess.Popen calls _winapi.CreateProcess. The current_directory is a 
wchar_t* string (Py_UNICODE*) passed to Windows CreateProcessW() (Unicode 
flavor of the API).

https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file#maximum-path-length-limitation

"In the Windows API (with some exceptions discussed in the following 
paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 
characters."

I guess that the workaround is to use the "\\?\" prefix for "extended-length 
path". For example, "\\?\D:\very long path".

=> "The Windows API has many functions that also have Unicode versions to 
permit an extended-length path for a maximum total path length of 32,767 
characters."

----------
nosy: +vstinner

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

Reply via email to