Sublime Forum

[SOLVED] Build system on Windows

#1

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,
		stdin=subprocess.PIPE,
		startupinfo=startupinfo,
		env=proc_env, 
		shell=shell)

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"],
“shell”:true,
“working_dir”:"${project_path:${folder}}",
“file_regex”:"^(…
?):([0-9]*)”,
“encoding”: “cp1252”
}

Hope this helps… :wink:

0 Likes

Unable to open res://Packages/Default/Delete Line.sublime-ma
#2

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.

0 Likes

#3

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!!!

0 Likes

#4

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

Adding:

stdin=subprocess.PIPE,

resolved the error.

0 Likes

#5

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!!

0 Likes

#6

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:

else: # 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)

-Roy

0 Likes