[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2019-03-08 Thread Geoff Alexander
Change by Geoff Alexander : -- status: open -> pending ___ Python tracker <https://bugs.python.org/issue36243> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2019-03-08 Thread Geoff Alexander
Geoff Alexander added the comment: This problem does not appear to be a race condition ("Time Of Check To Time Of Use" bug) in my case as the directory in question exists both before and after the os.listdir call. I got a workaround saying to wrap the os.listdir call in try/ex

[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2019-03-08 Thread Geoff Alexander
Change by Geoff Alexander : -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue36243> ___ ___ Python-bugs-list mailing list Unsubscrib

[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

[issue36243] Python os.listdir fails with FileNotFoundError when directory exists

2019-03-08 Thread Geoff Alexander
New submission from Geoff Alexander : I have the following code: ``` def handle_empty_directories(dir): if os.path.exists(dir): shouter.shout("%s exists" % dir) else: shouter.shout("%s doesn't exists" % dir)

[issue35678] subprocess.check_output(): OSError: [WinError 87]

2019-03-06 Thread Geoff Alexander
Geoff Alexander added the comment: The [WinError 87] does seems to be caused by the current directory's name being too long. The value of len(os.getcwd())is 260 when the exception occurs. The failing call was subprocess.check_output("git ls-files", shell=True). I've

[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 &qu

[issue35678] subprocess.check_output(): OSError: [WinError 87]

2019-03-04 Thread Geoff Alexander
Geoff Alexander added the comment: Here's the trace back I get from Python 3.7.2: Traceback (most recent call last): File "migration.py", line 169, in migrate() File "migration.py", line 80, in migrate rtc.acceptchangesintoworkspace(rtc.getchangeentr

[issue35678] subprocess.check_output(): OSError: [WinError 87]

2019-03-04 Thread Geoff Alexander
Geoff Alexander added the comment: I've recently hit this problem (or one that has the same symptoms): ``` Traceback (most recent call last): File "migration.py", line 169, in migrate() File "migration.py", line 80, in migrate rtc.a