[SRU] pycallgraph crashed with AttributeError
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
pycallgraph (Debian) |
Fix Released
|
Unknown
|
||||
pycallgraph (Ubuntu) | Status tracked in Oracular | |||||
Focal |
Fix Released
|
Medium
|
Unassigned | |||
Jammy |
Fix Released
|
Medium
|
Unassigned | |||
Noble |
Fix Released
|
Medium
|
Unassigned | |||
Oracular |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[ Impact ]
pycallgraph is completely unusable and crashes immediately when executed by the user.
$ pycallgraph --help
Traceback (most recent call last):
File "/usr/bin/
import pycallgraph as __pycallgraph
File "/usr/lib/
from .pycallgraph import PyCallGraph
File "/usr/lib/
from .output import Output
File "/usr/lib/
from .output import Output
File "/usr/lib/
from distutils.spawn import find_executable
ModuleNotFoundE
[ Test Plan ]
install python3-
As a basic test, execute "pycallgraph --help"
If the package is not fixed,it will fail with the above error.
With the fixed package, it will display the help menu.
As a more complete test:
copy the attached basic.py and use the command:
pycallgraph graphviz basic.py
It will create two png files "basic.png" and "pycallgraph.png".
[ Where problems could occur ]
The 'distutils' module is not available in Python3.12. 'distutils' was used previously to find the executable and was also used to get the path of the python lib. Now, its being replaced with 'shutil' and using 'which' to find the executable. And, 'sysconfig' is used to get the path of the python lib.
In the worst case, if 'which' or 'sysconfig' fails to find the path then the user will still see pycallgraph is failing but with a different error message.
[ Other Info ]
1. It has been fixed in Debian and so Oracular is also fixed now.
2. In Focal, the patch had to be modified to hardcode the path as I am unable to get the path '/usr/lib/
And, in Focal pycallgraph will be installed in that path, if 'tracer.py' does not get the correct path then the generated 'pycallgraph.png' will not be same as Jammy or Noble or Oracular with the same test file 'basic.py'.
[ Original Bug Description ]
pycallgraph fails to run with the error:
$ pycallgraph
Traceback (most recent call last):
File "/usr/bin/
import pycallgraph as __pycallgraph
File "/usr/lib/
from .pycallgraph import PyCallGraph
File "/usr/lib/
from .output import Output
File "/usr/lib/
from .output import Output
File "/usr/lib/
from distutils.spawn import find_executable
ModuleNotFoundE
ProblemType: Crash
DistroRelease: Ubuntu 24.04
Package: python3-pycallgraph 1.1.3-2
ProcVersionSign
Uname: Linux 6.8.0-22-generic x86_64
ApportVersion: 2.28.0-0ubuntu1
Architecture: amd64
CasperMD5CheckR
CrashCounter: 1
CurrentDesktop: ubuntu:GNOME
Date: Wed Apr 17 21:46:49 2024
ExecutablePath: /usr/bin/
InstallationDate: Installed on 2024-04-10 (7 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Beta amd64 (20240410)
InterpreterPath: /usr/bin/python3.12
JournalErrors: -- No entries --
PackageArchitec
ProcCmdline: /usr/bin/python3 /usr/bin/
Python3Details: /usr/bin/
PythonArgs: ['/usr/
PythonDetails: N/A
SourcePackage: pycallgraph
Title: pycallgraph crashed with AttributeError in strip_argv(): 'Config' object has no attribute 'command'
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sudo users
information type: | Private → Public |
tags: | removed: need-duplicate-check |
Changed in pycallgraph (Ubuntu): | |
importance: | Undecided → Medium |
Changed in pycallgraph (Ubuntu Focal): | |
status: | New → In Progress |
Changed in pycallgraph (Ubuntu Jammy): | |
status: | New → In Progress |
Changed in pycallgraph (Ubuntu Noble): | |
status: | New → In Progress |
Changed in pycallgraph (Ubuntu Oracular): | |
status: | New → In Progress |
assignee: | nobody → Sudip Mukherjee (sudipmuk) |
Changed in pycallgraph (Ubuntu Noble): | |
assignee: | nobody → Sudip Mukherjee (sudipmuk) |
Changed in pycallgraph (Ubuntu Jammy): | |
assignee: | nobody → Sudip Mukherjee (sudipmuk) |
Changed in pycallgraph (Ubuntu Focal): | |
assignee: | nobody → Sudip Mukherjee (sudipmuk) |
Changed in pycallgraph (Debian): | |
status: | Unknown → New |
Changed in pycallgraph (Debian): | |
status: | New → Fix Released |
Changed in pycallgraph (Ubuntu Noble): | |
importance: | Undecided → Medium |
Changed in pycallgraph (Ubuntu Jammy): | |
importance: | Undecided → Medium |
Changed in pycallgraph (Ubuntu Focal): | |
importance: | Undecided → Medium |
Changed in pycallgraph (Ubuntu Oracular): | |
assignee: | Sudip Mukherjee (sudipmuk) → nobody |
status: | In Progress → Fix Released |
Changed in pycallgraph (Ubuntu Jammy): | |
assignee: | Sudip Mukherjee (sudipmuk) → nobody |
description: | updated |
Changed in pycallgraph (Ubuntu Focal): | |
assignee: | Sudip Mukherjee (sudipmuk) → nobody |
The basic.py used in the testplan