This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Geoff.Alexander
Recipients Geoff.Alexander, paul.moore, steve.dower, tim.golden, zach.ware
Date 2019-03-06.14:37:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551883036.38.0.267750986311.issue36213@roundup.psfhosted.org>
In-reply-to
Content
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 <module>
    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
```

Python's subprocess module should handle long directory and files names on Windows where supported.  For older versions of Windows that don't support long directory and file names, an exception with a more informative error message than "OSError: [WinError 87]" should be thrown.
History
Date User Action Args
2019-03-06 14:37:16Geoff.Alexandersetrecipients: + Geoff.Alexander, paul.moore, tim.golden, zach.ware, steve.dower
2019-03-06 14:37:16Geoff.Alexandersetmessageid: <1551883036.38.0.267750986311.issue36213@roundup.psfhosted.org>
2019-03-06 14:37:16Geoff.Alexanderlinkissue36213 messages
2019-03-06 14:37:16Geoff.Alexandercreate