Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python subprocess.check_输出,错误退出代码结束程序_Python_Solaris - Fatal编程技术网

Python subprocess.check_输出,错误退出代码结束程序

Python subprocess.check_输出,错误退出代码结束程序,python,solaris,Python,Solaris,我在python方面处于非常基本的水平,我有这个问题 在solaris环境中执行的命令 exec_ldap = subprocess.check_output( ["/usr/bin/ldapsearch", "-T", "-t", "-h", ldapserver, "-p", ldapport, "-b", path_ldap, "objectClass=*", "certificaterevocationlist"], stderr=subprocess.STDOUT)

我在python方面处于非常基本的水平,我有这个问题

在solaris环境中执行的命令

exec_ldap = subprocess.check_output(
    ["/usr/bin/ldapsearch", "-T", "-t", "-h", ldapserver, "-p", ldapport, "-b", path_ldap, "objectClass=*", "certificaterevocationlist"],
    stderr=subprocess.STDOUT)
它返回了非零退出状态81,因为与ldap服务器的连接进入超时状态

但是,尽管我捕捉到了将输出打印到日志文件的异常,python脚本还是结束了,但我不知道为什么

我需要程序继续运行,尽管命令执行超时


提前感谢

您能将代码发布到捕获异常的位置吗?您必须向我们展示您的工作和方法。只有这样我们才能帮助你。没有prosa,只需要代码。>尝试:>-exec\u ldap\u q=subprocess。检查输出([“/usr/bin/ldapsearch”、“-”、“-t”、“-h”、ldapserver、“-p”、ldaport、“-b”、path\u ldap、“objectClass=*”、“certificaterejournalistlist”]、stderr=subprocess.STDOUT)>-但subprocess.calledprocess错误为e:>*logger.error(“错误连接到ldap服务器”+str(e))