每次我的Python程序结束时,我都会得到以下内容:
close failed in file object destructor:
IOError: [Errno 9] Bad file descriptor
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
RuntimeError: sys.meta_path must be a list of import hooksApport假设这不会是更多问题的原因,以防出了什么问题。然而,在我的例子中,Apport似乎是一个大问题。
我在一个系统中,我只是许多程序员中的一员,我没有根权限。因此,我想让我的Python程序简单地关闭Apport,而不是在全球范围内关闭Apport。
如何禁用我的用户帐户的Apport?
发布于 2013-06-25 07:01:06
这看起来是个问题。我会填补一个bug,因为如果程序在不同的环境中导致Apport崩溃,则无法保证它不会失败。
如果您真的想禁用您的程序的Apport,请尝试如下:
if sys.excepthook != sys.__excepthook__:
print("Warning: 3rd party exception hook is active")
if sys.excepthook.__name__ == 'apport_excepthook':
print(" killing Ubuntu's Apport hook")
sys.excepthook = sys.__excepthook__https://askubuntu.com/questions/309423
复制相似问题