Public bug reported:

  File "/usr/lib/python2.6/dist-packages/apport/REThread.py", line 34, in run
    self._retval = self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.6/dist-packages/apport/ui.py", line 84, in 
thread_collect_info
    not apport.packaging.is_distro_package(report['Package'].split()[0])) \
  File "/usr/lib/python2.6/dist-packages/apport/packaging_impl.py", line 134, 
in is_distro_package
    for line in open(f):
IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: 'firefox'

A short look at the source shows that os.listdir is used, but the
directory path is not joined onto the open:

        try:
            for f in os.listdir('/etc/apport/native-origins.d'):
                for line in open(f):
                    line = line.strip()
                    if line:
                        native_origins.append(line)
        except OSError:
            pass

Now, this is wrong on a number of issues:
os.listdir returns only the basenames => so you need 
open(os.path.join("/etc/apport/native-origins.d", f))
Furthermore, open raises an IOError, so the OSError only catches issues with 
os.listdir, so if it should cover the open too, it should be: except (OSError, 
IOError): # notice the tuple.

Alternatively you can also use glob.glob("/etc/apport/native-
origins.d/*"), that one includes the given path.

Package version: 1.13.3-0ubuntu2
Description:    Ubuntu 10.04.3 LTS
Release:        10.04

Expected behaviour: Bug reporter should not crash.
What happened: apport crashed with a traceback.

I can also provide a fix as a patch if needed, but it's rather a trivial
thing, packaging it up as a new package is probably more work, the
detailed description how to fix is above.

Thanks, Andreas

** Affects: ubuntu
     Importance: Undecided
         Status: New

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

Title:
  apport crashes when /etc/apport/native-origins.d contains any files.

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to