[英]subprocess.CalledProcessError: returned non-zero exit status 0
What is the meaning of this paradoxical error? 这个矛盾的错误是什么意思?
subprocess.CalledProcessError: Command '/home/travis/build/fritzo/pomagma/build/debug/src/cartographer/cartographer' returned non-zero exit status 0
subprocess.CalledProcessError:命令'/ home / travis / build / fritzo / pomagma / build / debug / src / cartographer / cartographer'返回非零退出状态0
It happens when I start a subprocess, then tell that subprocess to cleanly exit via a zmq socket. 当我启动一个子进程,然后告诉该子进程通过zmq套接字干净地退出时,就会发生这种情况。 It appears that while zmq is polling, the process exits cleanly (exit code 0), and then this error is raised.
看来在zmq进行轮询时,该进程会干净退出(退出代码0),然后引发此错误。
Here's the whole traceback (from a travis log ): 这是整个回溯(来自travis log ):
Traceback (most recent call last):
File "/home/travis/virtualenv/python2.7_with_system_site_packages/bin/pomagma.make", line 9, in <module>
load_entry_point('pomagma==0.2.8', 'console_scripts', 'pomagma.make')()
File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/parsable.py", line 181, in dispatch
dispatch(argv)
File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/parsable.py", line 129, in dispatch
parser(*args, **kwargs)
File "/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/parsable.py", line 64, in parser
fun(*typed_args, **typed_kwargs)
File "/home/travis/build/fritzo/pomagma/pomagma/make.py", line 130, in test_atlas
_test_atlas(theory)
File "/home/travis/build/fritzo/pomagma/pomagma/make.py", line 59, in _test_atlas
assert actual_size == expected_size
File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/home/travis/build/fritzo/pomagma/pomagma/cartographer/__init__.py", line 14, in load
client.stop()
File "/home/travis/build/fritzo/pomagma/pomagma/cartographer/client.py", line 207, in stop
self._call(request)
File "/home/travis/build/fritzo/pomagma/pomagma/cartographer/client.py", line 35, in _call
self._poll_callback()
File "/home/travis/build/fritzo/pomagma/pomagma/cartographer/server.py", line 66, in check
self.log_error()
File "/home/travis/build/fritzo/pomagma/pomagma/cartographer/server.py", line 73, in log_error
raise CalledProcessError(self._proc.poll(), BINARY)
subprocess.CalledProcessError: Command '/home/travis/build/fritzo/pomagma/build/debug/src/cartographer/cartographer' returned non-zero exit status 0
According to the docs, if your subprocess returns non-zero then it will raise that exception. 根据文档,如果您的子进程返回非零,则将引发该异常。 This is also the standard convention in Linux.
这也是Linux中的标准约定。 https://docs.python.org/2/library/subprocess.html
https://docs.python.org/2/library/subprocess.html
Try to include your subprocess client code try: <...> catch: <...> finally: sys.exit(0) 尝试包括您的子流程客户端代码,请尝试:<...>捕获:<...>最后:sys.exit(0)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.