apport crashes if sys.argv is empty or non-existent
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apport (Ubuntu) |
In Progress
|
Undecided
|
Martin Pitt |
Bug Description
Binary package hint: python-apport
When embedding python (as in with Boost Python) one sometimes will have an empty or non-existent sys.argv variable. If the program crashes, while the python instance is active, apport will run, but will crash with the following error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: __import__ not found
Error in sys.excepthook:
Traceback (most recent call last):
File "/var/lib/
binary = os.path.
AttributeError: 'module' object has no attribute 'argv'
This is because sys.argv doesn't exist for some embedded instances of python (this is a really rare instance).
A simple work-around (aka hack) is to edit
/var/lib/
And modify it look like:
import os
import sys
# new lines
try:
sys.argv
except:
sys.argv = ['no_main']
Changed in apport: | |
assignee: | nobody → pitti |
status: | New → In Progress |