python输出格式错误_Python raise child_exception OSError:[Errno 8]执行格式错误

我必须将Python脚本从使用Python 2.6的服务器移动到使用2.4的另一个服务器。我不得不作出一些修改。现在我卡住了。我不断收到此错误Python raise child_exception OSError:[Errno 8]执行格式错误

File "subprocess.py", line 975, in _execute_child

raise child_exception

OSError: [Errno 8] Exec format error

我的日志输出中:从rpntrans.py

Traceback (most recent call last):

File "/cnfs/dev/regions/que/cli/rpntrans_requests/scripts/0.6a/process.py", line 281, in ?

process(filename)

File "/cnfs/dev/regions/que/cli/rpntrans_requests/scripts/0.6a/process.py", line 259, in process

outputs = transformations[tr.tag](file).execute()

File "/cnfs/dev/regions/que/cli/rpntrans_requests/scripts/0.6a/process.py", line 114, in execute

t.execute()

File "/cnfs/dev/regions/que/cli/rpntrans/current/rpntrans.py", line 113, in execute

last_step.execute()

File "/cnfs/dev/regions/que/cli/rpntrans/current/rpntrans.py", line 941, in execute

stdout=sys.stdout, stderr=sys.stderr

File "subprocess.py", line 413, in call

return Popen(*args, **kwargs).wait()

File "subprocess.py", line 543, in __init__

errread, errwrite)

File "subprocess.py", line 975, in _execute_child

raise child_exception

OSError: [Errno 8] Exec format error

代码

subprocess.call([

os.path.join(module_root, 'bin/fst2r2c'),

file,

v_name,

str(r.ip2), str(r.ip2),

out_file,

'1', '0',

'%s (ip1:%i)' % (self.dict[v_name]["desc"], r.ip1),

self.dict[v_name]["units"],

self.format,

self.__get_interpolation(v_name)

],

stdout=sys.stdout, stderr=sys.stderr

)

anyhone有一个想法?

谢谢

+2

尝试使用'shell = True'。并参见http://stackoverflow.com/questions/6441507/executing-python-scripts-with-subprocess-call-using-shebang。 –

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值