Home Download Buy Blog Forum Support

[SOLVED] Build system on Windows

[SOLVED] Build system on Windows

Postby jice on Fri Nov 02, 2012 2:47 pm

With vanilla SublimeText 2.0.1, I can't run any build system on Windows XP. I keep getting this error :
Error 6 this handle is invalid

To fix it, I added the parameter stdin=subprocess.PIPE to the subprocess.Popen call in Data/Packages/Default/exec.py :

self.proc = subprocess.Popen(arg_list,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,

You also need to specify that your ouput uses cp1252. This is for example a makefile-less quick and dirty C++ build system :
"cmd": ["g++.exe src/*.cpp"],
"encoding": "cp1252"

Hope this helps.. ;)
Posts: 1
Joined: Fri Nov 02, 2012 2:41 pm

Re: [SOLVED] Build system on Windows

Postby rpardee on Fri Jan 18, 2013 9:35 pm

Helped me--thanks so much!

I think there was a KB update/hotfix or something that triggered the problem for me--it was working just fine until corporate pushed out a bunch of windows/office/.net hotfixes.
Posts: 33
Joined: Wed Jul 11, 2012 8:51 pm

Re: [SOLVED] Build system on Windows

Postby rykus0 on Wed Apr 03, 2013 3:12 pm

Just wanted to say that the first half of this solved the problem for me (I didn't need to change the encoding).

I had the problem while trying to run an Ant build on Windows XP.

Thanks for the help!!!
Posts: 1
Joined: Wed Apr 03, 2013 3:10 pm

Re: [SOLVED] Build system on Windows

Postby bizoo on Tue May 28, 2013 9:31 am

Same problem here on Windows 7:
startup, version: 2219 windows x64 channel: nightly

Code: Select all

resolved the error.
Posts: 958
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: [SOLVED] Build system on Windows

Postby fanatixx on Tue Aug 06, 2013 8:12 am

Couldn't get it to work on my win7 work computer where I don't have admin rights.
First half solved the problem, I'm eternally grateful!!
Posts: 1
Joined: Tue Aug 06, 2013 8:11 am

Re: [SOLVED] Build system on Windows

Postby rpardee on Mon Apr 06, 2015 5:17 pm

Leaving this here for myself at least:

Updated fix for ST3 (64-bit portable win version, when launched via command line (powershell) at least):

Around line 70 of exec.py, in "C:\tools\sublime\Packages\Default.sublime-package" (change name of that file to Default.sublime-package.zip, extract exec.py from it, edit, then add edited version back to zip, close the zip & rename it back to plain "Default.sublime-package" (and be sure to keep filename casing the same)) add the argument "stdin=subprocess.PIPE" to line 70. That's the third line here:

Code: Select all
            # Old style build system, just do what it asks
            self.proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE,
                stderr=subprocess.PIPE, startupinfo=startupinfo, env=proc_env, shell=shell)

Posts: 33
Joined: Wed Jul 11, 2012 8:51 pm

Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 15 guests