[issue36213] subprocess.check_output() fails with OSError: [WinError 87] when current directory name is too long

2021-03-16 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36213] subprocess.check_output() fails with OSError: [WinError 87] when current directory name is too long

2021-03-15 Thread Eryk Sun
Eryk Sun added the comment: As discussed in msg337357, the Windows API does not support setting the current working directory to a path that starts with \\?\ or \\.\. It's dysfunctional in many cases. Anyway, using a \\?\ path does not remove the length limit on the working directory, which

[issue36213] subprocess.check_output() fails with OSError: [WinError 87] when current directory name is too long

2019-03-08 Thread Geoff Alexander
Geoff Alexander added the comment: Using the "\\?\" prefix does not work. Here's a small example: ``` import os import subprocess os.chdir(r"\\?\C:\Users") output = subprocess.check_output("dir", shell=True) ``` Using Python 3.7.2 64-bit on Windows 10 fails with ```

[issue36213] subprocess.check_output() fails with OSError: [WinError 87] when current directory name is too long

2019-03-06 Thread Eryk Sun
Eryk Sun added the comment: Long-path support in Windows 10 does not extend to the lpCurrentDirectory parameter of CreateProcessW. If the path length exceeds the old limit of MAX_PATH - 2 characters (not counting the required trailing backslash and null), CreateProcessW fails with either

[issue36213] subprocess.check_output() fails with OSError: [WinError 87] when current directory name is too long

2019-03-06 Thread STINNER Victor
STINNER Victor added the comment: > As Eryk said on the other issue, ... link: https://bugs.python.org/issue35678#msg337171 -- ___ Python tracker ___

[issue36213] subprocess.check_output() fails with OSError: [WinError 87] when current directory name is too long

2019-03-06 Thread Steve Dower
Steve Dower added the comment: The problem with improving the generic error message is that we then build a platform limitation into Python and if a later version of Windows fixes it then Python needs to make another fix. As Eryk said on the other issue, this may be because the current

[issue36213] subprocess.check_output() fails with OSError: [WinError 87] when current directory name is too long

2019-03-06 Thread STINNER Victor
STINNER Victor 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).

[issue36213] subprocess.check_output() fails with OSError: [WinError 87] when current directory name is too long

2019-03-06 Thread SilentGhost
Change by SilentGhost : -- type: -> behavior versions: +Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36213] subprocess.check_output() fails with OSError: [WinError 87] when current directory name is too long

2019-03-06 Thread Geoff Alexander
New submission from Geoff Alexander : I've found that subprocess.check_output() fails on Windows with OSError: [WinError 87] when the current directory's name is too long: ``` Traceback (most recent call last): File "migration.py", line 169, in migrate() File "migration.py", line 80,