[Bug 264724] Re: apport_python_hook breaks under python-dbg unless you have python-apt-dbg installed

Matthias Klose doko at ubuntu.com
Sun Mar 24 20:40:32 UTC 2013


so it looks like this is something which cannot be done in python-
defaults itself. site.py has:

+    # install the apport exception handler if available
+    try:
+        import apport_python_hook
+    except ImportError:
+        pass
+    else:
+        apport_python_hook.install()

so apport_python_hook should do the same try/except when trying to
import the python-apt-dbg module.

** Package changed: python-defaults (Ubuntu) => apport (Ubuntu)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/264724

Title:
  apport_python_hook breaks under python-dbg unless you have python-apt-
  dbg installed

Status in “apport” package in Ubuntu:
  Triaged

Bug description:
  Hi,

  If one doesn't have python-apt-dbg installed and runs:
  % python-dbg -c 'import foo'
  this is the result:
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  ImportError: No module named foo
  Error in sys.excepthook:
  Traceback (most recent call last):
    File "/usr/lib/python2.5/site-packages/apport_python_hook.py", line 38, in apport_excepthook
      from apport.packaging_impl import impl as packaging
    File "/usr/lib/python2.5/site-packages/apport/__init__.py", line 1, in <module>
      from apport.report import Report
    File "/usr/lib/python2.5/site-packages/apport/report.py", line 21, in <module>
      import fileutils
    File "/usr/lib/python2.5/site-packages/apport/fileutils.py", line 16, in <module>
      from packaging_impl import impl as packaging
    File "/usr/lib/python2.5/site-packages/apport/packaging_impl.py", line 18, in <module>
      import apt
    File "/usr/lib/python2.5/site-packages/apt/__init__.py", line 2, in <module>
      import apt_pkg
  ImportError: /usr/lib/python2.5/site-packages/apt_pkg.so: undefined symbol: Py_InitModule4_64

  Original exception was:
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  ImportError: No module named foo
  [23315 refs]

  After installing python-apt-dbg, the result is the expected one:
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  ImportError: No module named foo
  [29873 refs]

  
  I think python-apport should either depend on python-apt-dbg or disable the hook for python*-dbg sessions.

  Cheers,

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/264724/+subscriptions




More information about the foundations-bugs mailing list