** Description changed:

  [ Impact ]
  
  pycallgraph is completely unusable and crashes immediately when executed
  by the user.
  
- 
  $ pycallgraph --help
  Traceback (most recent call last):
-   File "/usr/bin/pycallgraph", line 11, in <module>
-     import pycallgraph as __pycallgraph
-   File "/usr/lib/python3/dist-packages/pycallgraph/__init__.py", line 11, in 
<module>
-     from .pycallgraph import PyCallGraph
-   File "/usr/lib/python3/dist-packages/pycallgraph/pycallgraph.py", line 3, 
in <module>
-     from .output import Output
-   File "/usr/lib/python3/dist-packages/pycallgraph/output/__init__.py", line 
3, in <module>
-     from .output import Output
-   File "/usr/lib/python3/dist-packages/pycallgraph/output/output.py", line 3, 
in <module>
-     from distutils.spawn import find_executable
+   File "/usr/bin/pycallgraph", line 11, in <module>
+     import pycallgraph as __pycallgraph
+   File "/usr/lib/python3/dist-packages/pycallgraph/__init__.py", line 11, in 
<module>
+     from .pycallgraph import PyCallGraph
+   File "/usr/lib/python3/dist-packages/pycallgraph/pycallgraph.py", line 3, 
in <module>
+     from .output import Output
+   File "/usr/lib/python3/dist-packages/pycallgraph/output/__init__.py", line 
3, in <module>
+     from .output import Output
+   File "/usr/lib/python3/dist-packages/pycallgraph/output/output.py", line 3, 
in <module>
+     from distutils.spawn import find_executable
  ModuleNotFoundError: No module named 'distutils'
- 
  
  [ Test Plan ]
  
  install python3-pycallgraph.
  
  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 ]
  
- It has been fixed in Debian and so Oracular is also fixed now.
+ 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/python3/dist-packages' from any of ths syconfig 
opions. All the sysconfig variables and paths can be seen with the command 
'python3 -m sysconfig' and there is no way to generate the required path from 
sysconfig. 
+ 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/pycallgraph", line 11, in <module>
      import pycallgraph as __pycallgraph
    File "/usr/lib/python3/dist-packages/pycallgraph/__init__.py", line 11, in 
<module>
      from .pycallgraph import PyCallGraph
    File "/usr/lib/python3/dist-packages/pycallgraph/pycallgraph.py", line 3, 
in <module>
      from .output import Output
    File "/usr/lib/python3/dist-packages/pycallgraph/output/__init__.py", line 
3, in <module>
      from .output import Output
    File "/usr/lib/python3/dist-packages/pycallgraph/output/output.py", line 3, 
in <module>
      from distutils.spawn import find_executable
  ModuleNotFoundError: No module named 'distutils'
  
  ProblemType: Crash
  DistroRelease: Ubuntu 24.04
  Package: python3-pycallgraph 1.1.3-2
  ProcVersionSignature: Ubuntu 6.8.0-22.22-generic 6.8.1
  Uname: Linux 6.8.0-22-generic x86_64
  ApportVersion: 2.28.0-0ubuntu1
  Architecture: amd64
  CasperMD5CheckResult: pass
  CrashCounter: 1
  CurrentDesktop: ubuntu:GNOME
  Date: Wed Apr 17 21:46:49 2024
  ExecutablePath: /usr/bin/pycallgraph
  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 --
  PackageArchitecture: all
  ProcCmdline: /usr/bin/python3 /usr/bin/pycallgraph
  Python3Details: /usr/bin/python3.12, Python 3.12.3, python3-minimal, 
3.12.3-0ubuntu1
  PythonArgs: ['/usr/bin/pycallgraph']
  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

** Changed in: pycallgraph (Ubuntu Focal)
     Assignee: Sudip Mukherjee (sudipmuk) => (unassigned)

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

Title:
  [SRU] pycallgraph crashed with AttributeError

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


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

Reply via email to