Test Drive won't start with AttributeError

Bug #1037671 reported by Dražen Lučanin on 2012-08-16
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

When launching testdrive in Precise it crashes right away with the following error:

kermit@Glamdring:~$ testdrive
INFO: version passed: False
INFO: config passed: None
INFO: Trying config in /etc/testdriverc
INFO: Using configuration in /etc/testdriverc
INFO: Trying config in /home/kermit/.testdriverc
INFO: Trying config in /home/kermit/.config/testdrive/testdriverc
INFO: Using KVM for virtual machine hosting...
Traceback (most recent call last):
  File "/usr/bin/testdrive", line 445, in <module>
  File "/usr/bin/testdrive", line 309, in main
  File "/usr/lib/python2.7/dist-packages/testdrive/testdrive.py", line 203, in set_defaults
    self.SMP = commands.getoutput("grep -c ^processor /proc/cpuinfo")
AttributeError: 'module' object has no attribute 'getoutput'

The gtk version won't start either:

kermit@Glamdring:~$ testdrive-gtk
Traceback (most recent call last):
  File "/usr/bin/testdrive-gtk", line 71, in <module>
    from testdrivegtk import (
  File "/usr/lib/python2.7/dist-packages/testdrivegtk/AboutTestdrivegtkDialog.py", line 30, in <module>
    version = commands.getstatusoutput("dpkg -l testdrive-gtk | tail -n1 | awk '{print $3}'")
AttributeError: 'module' object has no attribute 'getstatusoutput'

I tried updating to the latest version in the PPA, but that didn't do anything. apt-cache show testdrive says it is Version: 3.15-0ubuntu1.

Dražen Lučanin (kermit666) wrote :

OK, I've gone through the source code and located the cause of this error - it's specific to my machine only, as I was trying out some dev versions of other packages. After working to fix Bug #949798 on my current installation, I installed the latest version of bzr-gtk available on Launchpad. **This version implements a "commands" Python package which masks the package of the same name from the Python Standard Library that is used by Testdrive**. Of course, the interfaces don't match as they offer different functionality so I was getting the AttributeError.

I fixed it by editing /usr/local/lib/python2.7/dist-packages/easy-install.pth and removing the path to the local bzr-gtk code I branched from Launchpad. Testdrive works now, so this bug can be closed.

Somebody should probably keep an eye on this commands package in bzr-gtk - it should probably be renamed (if it hasn't been already) not to cause any problems or more likely I installed the dev version the wrong way, skipping some top-level bzr-gtk package.

Daniel Kessel (dkessel) wrote :

I guess we could close this one.

Daniel Kessel (dkessel) on 2015-06-10
Changed in testdrive:
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers