Sublime Text 构建系统产生 [WinError 6] The handle is invalid 错误

Sublime Text build system generates [WinError 6] The handle is invalid error

我正在尝试创建 Sublime Text 3 build system to render and Asciidoc-formatted document using AsciiDoctor

AsciiDoc.sublime-构建:

{
    "cmd": ["asciidoctor","$file"],
    "selector": "source.asciidoc"
}

当我执行构建Ctrl+B时,出现错误:

[WinError 6] The handle is invalid
[cmd: ['asciidoctor', 'C:\Users\XXXX\Desktop\hello\hello.asc']]
[dir: C:\Users\XXXX\Desktop\hello]
[path: c:\tools\ruby193\bin\asciidoctor]
[Finished]

我能够通过 Windows 命令处理器、PowerShell 和 Ruby 提示成功呈现文档。

此构建脚本导致相同的错误:

{
    "cmd": ["asciidoctor","$file"],
    "path": "c:\tools\ruby193\bin\asciidoctor",
    "shell": true,
    "selector": "source.asciidoc"
}

我错过了什么?

找到解决方案:Build system: "The handle is invalid"

最终回复:

by showka on Sun Oct 02, 2011 7:34 pm Thank you very much, launching Sublime Text outside of the command prompt gets rid of this problem.

I've tried setting PYTHONPATH to run from the prompt but that won't fix it. My command prompt has so much goo in the environment variables I'm sure something else is tripping it up as well. :) For now I'll just make a second batch file to launch Sublime with certain programs added to the path.

...

更新:我发现了这个问题,现在可以从我的命令提示符 运行 它了。

这是我的批处理文件以前的样子:

代码:Select全部 SET PYTHONPATH=START "Sublime Text 2" /B "C:\Program Files\Sublime Text 2\sublime_text.exe" %*

/B 选项由于某种原因搞砸了。通常我需要那个 防止命令提示符等待启动的程序 退出,但是对于 Sublime,出于某种原因它是不必要的。以 选项关闭使其工作。