无法确定Eclipse中底层os:nt的_shell_命令

无法确定Eclipse中底层os:nt的_shell_命令,shell,process,path,jython,Shell,Process,Path,Jython,我有一个java应用程序,它执行一个python脚本,但最终失败 cmd = "cmd /c asm.bat < 1.ADD.asm 2> nul" os.system(cmd) subprocess.py中的第456行在这里 def call(*popenargs, **kwargs): """Run command with arguments. Wait for command to complete, then return the returncode

我有一个java应用程序,它执行一个python脚本,但最终失败

cmd = "cmd /c asm.bat < 1.ADD.asm 2> nul"
os.system(cmd)
subprocess.py中的第456行在这里

def call(*popenargs, **kwargs):
    """Run command with arguments.  Wait for command to complete, then
    return the returncode attribute.

    The arguments are the same as for the Popen constructor.  Example:

    retcode = call(["ls", "-l"])
    """
    return Popen(*popenargs, **kwargs).wait() # line 456

奇怪的是,我在os.py中找不到os.system(),而是在
subprocess.py
中调用
call
函数。在
\u execute\u child
中的第1238行,
\u shell\u command
为无,导致错误。在到达之前,将执行
\u setup\u platform
,并在这两种情况下返回
\u get\u shell\u commands=(['cmd.exe','/c'],['command.com','/c'])
。通过
distutils.spawn.find_executable(executable)
将第一个可执行cmd.exe转换为
C:\windows\system32\cmd.exe
,而当我从调试器启动应用程序时,
cmd.exe
command.com
将转换为
None
distutils.spawn.find_executable(executable)
基本上迭代
path
env变量中的所有条目,将executable
cmd.exe
附加到末尾,如果该文件存在,则返回结果。但当应用程序启动Eclipse时,path env是空的,因为我已经覆盖了它。

我不得不使用
mypath${env_var:PATH}
在应用程序启动配置中,如中所述。

在windows上,我遇到了类似的问题。这是因为PATH环境变量已被修改,丢失了

“%SystemRoot%\system32;”SystemRoot%;'

def call(*popenargs, **kwargs):
    """Run command with arguments.  Wait for command to complete, then
    return the returncode attribute.

    The arguments are the same as for the Popen constructor.  Example:

    retcode = call(["ls", "-l"])
    """
    return Popen(*popenargs, **kwargs).wait() # line 456