CDuke / sublime-tfs

Use TFS inside Sublime Text 2/3
5 stars 4 forks source link

Invalid handle error #18

Open CDuke opened 9 years ago

CDuke commented 9 years ago

Originally reported by: Anonymous


Below is the console output of errors attempting to get the status of a file and checking out a file:

commands: [['C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/TF.exe', 'status', 'C:\\User\\KMS\\STS-KMS\\modules\\stskms\\Init-1.0.tm']]
is_graph: [False]
working_dir: [C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE]
Exception in thread Thread-3:
Traceback (most recent call last):
  File "./threading.py", line 901, in _bootstrap_inner
  File "C:\Users\douglasp\AppData\Roaming\Sublime Text 3\Packages\Sublime TFS\sublime_tfs.py", line 135, in run
    (self.success, self.message) = self.method(self.m_path)
  File "C:\Users\douglasp\AppData\Roaming\Sublime Text 3\Packages\Sublime TFS\sublime_tfs.py", line 81, in status
    return self.run_command(["status"], path)
  File "C:\Users\douglasp\AppData\Roaming\Sublime Text 3\Packages\Sublime TFS\sublime_tfs.py", line 103, in run_command
    return self.__run_command(commands_with_credentials, is_graph)
  File "C:\Users\douglasp\AppData\Roaming\Sublime Text 3\Packages\Sublime TFS\sublime_tfs.py", line 118, in __run_command
    p = subprocess.Popen(commands, stderr=subprocess.PIPE, stdout=subprocess.PIPE, startupinfo=startup_info)
  File "./subprocess.py", line 789, in __init__
  File "./subprocess.py", line 988, in _get_handles
  File "./subprocess.py", line 1038, in _make_inheritable
OSError: [WinError 6] The handle is invalid

Package Control: No updated packages
commands: [['C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/TF.exe', 'checkout', 'C:\\User\\KMS\\STS-KMS\\modules\\stskms\\Init-1.0.tm']]
is_graph: [False]
working_dir: [C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE]
Exception in thread Thread-5:
Traceback (most recent call last):
  File "./threading.py", line 901, in _bootstrap_inner
  File "C:\Users\douglasp\AppData\Roaming\Sublime Text 3\Packages\Sublime TFS\sublime_tfs.py", line 135, in run
    (self.success, self.message) = self.method(self.m_path)
  File "C:\Users\douglasp\AppData\Roaming\Sublime Text 3\Packages\Sublime TFS\sublime_tfs.py", line 55, in checkout
    return self.run_command(["checkout"], path)
  File "C:\Users\douglasp\AppData\Roaming\Sublime Text 3\Packages\Sublime TFS\sublime_tfs.py", line 103, in run_command
    return self.__run_command(commands_with_credentials, is_graph)
  File "C:\Users\douglasp\AppData\Roaming\Sublime Text 3\Packages\Sublime TFS\sublime_tfs.py", line 118, in __run_command
    p = subprocess.Popen(commands, stderr=subprocess.PIPE, stdout=subprocess.PIPE, startupinfo=startup_info)
  File "./subprocess.py", line 789, in __init__
  File "./subprocess.py", line 988, in _get_handles
  File "./subprocess.py", line 1038, in _make_inheritable
OSError: [WinError 6] The handle is invalid

jujaro commented 5 years ago

This seems to happen when you start sublime from the windows console. It can be fixed by adding stdin=subprocess.PIPE to the call to Popen like:

p = subprocess.Popen(commands, stderr=subprocess.PIPE, stdout=subprocess.PIPE, stdin=subprocess.PIPE, startupinfo=startup_info)