Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid handle error #18

Open
CDuke opened this issue Feb 18, 2015 · 1 comment
Open

Invalid handle error #18

CDuke opened this issue Feb 18, 2015 · 1 comment

Comments

@CDuke
Copy link
Owner

CDuke commented Feb 18, 2015

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
Copy link

jujaro commented Jun 12, 2019

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants