[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 
open Issue 36213 to track this problem.

--

___
Python tracker 

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



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

2019-03-05 Thread STINNER Victor


STINNER Victor  added the comment:

> Geoff, we probably need a new issue for this,

Yes please, this issue is closed.

> Prior to Windows 10, the working directory is limited to MAX_PATH - 2 (258) 
> characters. (...) CreateProcessW fails with ERROR_INVALID_PARAMETER (87).

Geoff: for your bug report, please dump len(os.getcwd()) as Eryk asked, but try 
also to dump all arguments passed to CreateProcess, or at least arguments 
passed to subprocess.

--

___
Python tracker 

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



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

2019-03-05 Thread Eryk Sun


Eryk Sun  added the comment:

Geoff, we probably need a new issue for this, but first, please report the 
value of len(os.getcwd()) in a case where check_output() fails. 

Prior to Windows 10, the working directory is limited to MAX_PATH - 2 (258) 
characters. (Windows uses the last two characters internally for a trailing 
backslash and a terminating null.) However, even with long-path support enabled 
in Windows 10, CreateProcessW retains the original WINAPI limit, which I assume 
is because the current implementation doesn't know whether the child supports 
long paths. If the inherited current directory exceeds this limit, 
CreateProcessW fails with ERROR_INVALID_PARAMETER (87).

--
nosy: +eryksun

___
Python tracker 

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



[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.getchangeentriestoaccept(changeentries, 
history))
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\rtcFunctions.py",
 line 310, in acceptchangesintoworkspace
Commiter.addandcommit(changeEntry)
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\gitFunctions.py",
 line 97, in addandcommit
Commiter.handle_captitalization_filename_changes()
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\gitFunctions.py",
 line 130, in handle_captitalization_filename_changes
files = shell.getoutput("git ls-files")
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\shell.py",
 line 33, in getoutput
outputasbytestring = check_output(command, shell=True)
  File 
"C:\Users\GeoffAlexander\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py",
 line 395, in check_output
**kwargs).stdout
  File 
"C:\Users\GeoffAlexander\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py",
 line 472, in run
with Popen(*popenargs, **kwargs) as process:
  File 
"C:\Users\GeoffAlexander\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py",
 line 775, in __init__
restore_signals, start_new_session)
  File 
"C:\Users\GeoffAlexander\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py",
 line 1178, in _execute_child
startupinfo)
OSError: [WinError 87] The parameter is incorrect

--

___
Python tracker 

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



[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.acceptchangesintoworkspace(rtc.getchangeentriestoaccept(changeentries, 
history))
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\rtcFunctions.py",
 line 310, in acceptchangesintoworkspace
Commiter.addandcommit(changeEntry)
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\gitFunctions.py",
 line 97, in addandcommit
Commiter.handle_captitalization_filename_changes()
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\gitFunctions.py",
 line 130, in handle_captitalization_filename_changes
files = shell.getoutput("git ls-files")
  File 
"c:\Users\GeoffAlexander\Documents\Nirvana\RTC2Git\git-repositories\rtc2git-migration-tool\shell.py",
 line 33, in getoutput
outputasbytestring = check_output(command, shell=True)
  File 
"C:\Users\GeoffAlexander\AppData\Local\Programs\Python\Python36\lib\subprocess.py",
 line 356, in check_output
**kwargs).stdout
  File 
"C:\Users\GeoffAlexander\AppData\Local\Programs\Python\Python36\lib\subprocess.py",
 line 423, in run
with Popen(*popenargs, **kwargs) as process:
  File 
"C:\Users\GeoffAlexander\AppData\Local\Programs\Python\Python36\lib\subprocess.py",
 line 729, in __init__
restore_signals, start_new_session)
  File 
"C:\Users\GeoffAlexander\AppData\Local\Programs\Python\Python36\lib\subprocess.py",
 line 1017, in _execute_child
startupinfo)
OSError: [WinError 87] The parameter is incorrect
```

I've tried Python 3.7.2 32-bit, 3.7.2 64-bit, and 3.6.8 64-bit on Windows 10.  
The error occurs in a long running Python script after more than one and half 
hours.  The subprocess.check_output call at shell.py:33 is successfully called 
hundreds, probably thousands, of times before failing.

I see that the issue is reported as resolved.  But I'm not understanding what 
is meant by

```
a new version of the code has been released
```

I'm running the latest version of Python, Python 3.7.2, from 
https://www.python.org/downloads/windows/ (as well as the previous version 
3.6.8).  Is there a later version of Python I can try?  Or do I need to get a 
newer version of the Python subprocess module?

I'm new to Python and wasn't sure if I should reopen this issue or create a new 
issue.  Please let me know if there any additional information I can collect to 
help debug this problem.

--
nosy: +gd...@us.ibm.com

___
Python tracker 

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



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

2019-01-09 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, you're welcome ;-)

--

___
Python tracker 

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



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

2019-01-09 Thread MaximilianSP


Change by MaximilianSP :


--
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



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

2019-01-09 Thread MaximilianSP


MaximilianSP  added the comment:

Hello Victor, 

a new version of the code has been released and I now get another error. I will 
mark the issue as resolved. Thank you for the quick response!

--
resolution:  -> not a bug

___
Python tracker 

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



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

2019-01-07 Thread MaximilianSP


MaximilianSP  added the comment:

Thank you for the input Victor. I will need a little time to dig in the code 
and check the attributes. I am fairly new to python :)

You are right that the code doesn't crash. Just I cannot continue with the 
following steps. That is why I thought it crashed.

--

___
Python tracker 

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



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

2019-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

"Issue with execute_child in startupinfo"

I don't think that the issue is related to startupinfo at all, since you don't 
specify this parameter in your check_output() call. Python shows you 
"startupinfo)" in the traceback because the function call takes multiple lines 
in the source code.

This issue is not a crash: it's possible to catch the exception and continue 
the execution.

--
title: Issue with execute_child in startupinfo -> subprocess.check_output(): 
OSError: [WinError 87]
type: crash -> 

___
Python tracker 

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