为什么子进程在这里抛出OSError?

mar*_*rue 6 python django ubuntu mod-wsgi

我编写了自己的模块,主要处理django站点的文件字段.搞乱了与mod_wsgi相关的一些事情(通过更新到3.3解决了),我得到了运行的代码.在所有必要的导入之后,在定义任何类或函数之前,我测试sox的可用性,这是我的一些模块函数必不可少的audiocommandlinetool:

sox = 'path/to/sox'
test=subprocess.Popen([sox,'-h'], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
error=test.communicate()[1]
if error:
    raise EnvironmentError((1,'Sox not installed properly'),)
Run Code Online (Sandbox Code Playgroud)

这很好.现在我已经从8.04更新了ubuntu到10.04,代码在subprocess.Popen调用行中止,抛出以下错误信息:

File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error  
Run Code Online (Sandbox Code Playgroud)

我已经找到了sox的执行权,我不知道在哪里寻找解决方案.子进程执行权限是否有限?任何提示可能会发生什么?

mar*_*rue 1

阿帕拉的提示解决了问题。如果同样的事情再次发生,请务必尝试不同版本的 sox。即使 sox 在命令行上工作,它也可能会导致子进程出现问题。