PythonDetails contains an error message if python not installed

Bug #1769262 reported by Brian Murray on 2018-05-04
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Brian Murray

Bug Description

[Test Case]
0) ensure python is not installed on the system
1) launch update-manager
2) kill update-manager
3) view the crash report

With the version of apport in the archive you will see messy PythonDetails like below. With the version of apport from -proposed you will instead see:

PythonDetails: N/A

[Regression Potential]
The fix for this also modified the code which creates Python3Details so we should ensure that Python3Details is not broken.

Original Description
In an Ubuntu 18.04 apport-package report, bug 1768866, we can see the following which looks super messy:

PythonDetails: /root/Error: command ['which', 'python'] failed with exit code 1:, Error: [Errno 2] Aucun fichier ou dossier de ce type: "/root/Error: command ['which', 'python'] failed with exit code 1:": "/root/Error: command ['which', 'python'] failed with exit code 1:", unpackaged

Brian Murray (brian-murray) wrote :

This'll make it look nicer.

@@ -519,6 +519,9 @@
 def add_python_details(key, python, report):
     '''Add comma separated details about which python is being used'''
     python_path = apport.hookutils.command_output(['which', python])
+ if python_path.startswith('Error: '):
+ report[key] = 'N/A'
+ return
     python_link = apport.hookutils.command_output(['readlink', '-f',
     python_pkg = apport.fileutils.find_file_package(python_path)

description: updated
tags: added: id-5ae35ea55ac10e9203cade8d
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.20.10-0ubuntu1

apport (2.20.10-0ubuntu1) cosmic; urgency=medium

  * New upstream release:
    - backends/ when using a permanent sandbox better
      check for the package being already available thereby reducing quantity
      of downloads.
    - apport/ Use timeout parameter in subprocess to limit how long
      we'll wait for gdb to return information as gdb can hang with some core
    - data/apport: Fix PEP8 issues
    - apport/ Include ProblemType in reports which are updated as
      package hooks may expect the report to have a ProblemType. (LP: #1766794)
    - test/ modify run_crash_kernel test to account for the fact
      that linux-image-$kvers-$flavor is now built from the linux-signed
      source package on amd64 and ppc64el. (LP: #1766740)
  * data/general-hooks/ Fix UnicodeDecodeError when processing
    DpkgTerminalLog. (LP: #1766337)
  * data/general-hooks/ Don't display a messy error if python or
    python3 is not installed. (LP: #1769262)
  * debian/apport.links: -> package
    hook (LP: #1766740)
  * data/package-hooks/ Redirect bugs filed about the
    linux-signed source package to linux. (LP: #1766740)

 -- Brian Murray <email address hidden> Thu, 10 May 2018 09:31:34 -0700

Changed in apport (Ubuntu):
status: New → Fix Released
Changed in apport (Ubuntu Bionic):
status: New → In Progress
importance: Undecided → Low
assignee: nobody → Brian Murray (brian-murray)
description: updated
description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers