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

Bug #264724 reported by Loïc Minier
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Expired
Low
Unassigned

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,

Tags: packaging
Andreas Moog (ampelbein)
Changed in apport:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Marco Rodrigues (gothicx) wrote :

It can be reproduced on karmic using $ python-dbg -c 'import apport'

Revision history for this message
Martin Pitt (pitti) wrote :

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

Introducing a dependency to python-apt-dbg sounds wrong, since we don't want to install python-dbg, python-apt-dbg and friends by default. This essentially seems to be a problem in the -dbg packages themselves, when having only some installed, but not the ones from dependencies. I don't think we can fix this in apport in any way, since it's a general problem.

Changed in apport (Ubuntu):
status: Confirmed → Won't Fix
Loïc Minier (lool)
affects: apport (Ubuntu) → python-defaults (Ubuntu)
Changed in python-defaults (Ubuntu):
status: Won't Fix → Triaged
Revision history for this message
Matthias Klose (doko) wrote :

so maybe provide a shell script which looks for installed modules and installs the corresponding -dbg package? in this case, this should be something for devscripts?

Revision history for this message
Matthias Klose (doko) wrote :

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.

affects: python-defaults (Ubuntu) → apport (Ubuntu)
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in apport (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for apport (Ubuntu) because there has been no activity for 60 days.]

Changed in apport (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.