← Back to team overview

apport-hackers team mailing list archive

[Merge] lp:~brian-murray/apport/bug-1365137 into lp:apport

 

Brian Murray has proposed merging lp:~brian-murray/apport/bug-1365137 into lp:apport.

Requested reviews:
  Apport upstream developers (apport-hackers)
Related bugs:
  Bug #1365137 in apport (Ubuntu): "if apport can't determine the package it creates a report without a package key"
  https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1365137

For more details, see:
https://code.launchpad.net/~brian-murray/apport/bug-1365137/+merge/233262

I think setting the package to something when we cannot determine it would be helpful for finding these issues in the Error Tracker so that we can then research why no package was found.
-- 
https://code.launchpad.net/~brian-murray/apport/bug-1365137/+merge/233262
Your team Apport upstream developers is requested to review the proposed merge of lp:~brian-murray/apport/bug-1365137 into lp:apport.
=== modified file 'apport/report.py'
--- apport/report.py	2014-08-29 10:32:33 +0000
+++ apport/report.py	2014-09-03 20:30:31 +0000
@@ -279,6 +279,7 @@
             else:
                 package = apport.fileutils.find_file_package(self['ExecutablePath'])
             if not package:
+                self['Package'] = 'unknown'
                 return
 
         try:

=== modified file 'test/test_report.py'
--- test/test_report.py	2014-08-29 10:32:33 +0000
+++ test/test_report.py	2014-09-03 20:30:31 +0000
@@ -43,7 +43,7 @@
         pr = apport.report.Report()
         pr['ExecutablePath'] = '/nonexisting'
         pr.add_package_info()
-        self.assertTrue('Package' not in pr)
+        self.assertEqual(pr['Package'], 'unknown')
 
     def test_add_os_info(self):
         '''add_os_info().'''


Follow ups