python help>>模块给出了分段错误 - 如何修复?

时间:2012-09-01 00:28:27

标签: python

欢迎使用Python 2.7!这是在线帮助实用程序。 ...

>> help()

help> modules

Please wait a moment while I gather a list of all available modules...

/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  from gtk import _gtk

** (python:9642): CRITICAL **: pyg_register_boxed: assertion `boxed_type != 0' failed
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: cannot register existing type `GdkDevice'
  from gtk import _gtk
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_type_get_qdata: assertion `node != NULL' failed
  from gtk import _gtk
Segmentation fault
durrantm.../dmWorkflow$ 

1 个答案:

答案 0 :(得分:5)

不幸的是,在Python上使用help时,这是一个已知问题。它目前必须导入模块来检查其文档字符串,如果模块在导入时执行代码并调用期望某个执行上下文或可能只是错误的第三方库,则可能导致崩溃。这是关于这个具体案例的open Ubuntu issuePython issue tracker中存在许多与help导入导致的类似崩溃相关的未解决问题。