[apport] pycentral crashed with AttributeError in install()

Bug #93518 reported by Dominic Durdan on 2007-03-18
14
Affects Status Importance Assigned to Milestone
python-central (Ubuntu)
Medium
Matthias Klose
Nominated for Feisty by Dominic Durdan

Bug Description

Binary package hint: python-central

pycentral crashes on updating of deskbar-applet in feisty

ProblemType: Crash
Architecture: i386
Date: Sun Mar 18 13:48:38 2007
DistroRelease: Ubuntu 7.04
ExecutablePath: /usr/bin/pycentral
InterpreterPath: /usr/bin/python2.5
Package: python-central 0.5.12ubuntu2
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/pycentral pkginstall onboard
ProcCwd: /home/dom
ProcEnviron:
 LANGUAGE=en
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
 LANG=en_US.UTF-8
 SHELL=/bin/bash
PythonArgs: ['/usr/bin/pycentral', 'pkginstall', 'onboard']
SourcePackage: python-central
Uname: Linux wintermute 2.6.20-10-generic #2 SMP Mon Mar 12 00:02:49 UTC 2007 i686 GNU/Linux

Dominic Durdan (ddurdan) wrote :
Dominic Durdan (ddurdan) wrote :
Daniel Holbach (dholbach) wrote :

Matthias: does this change make sense?

Changed in python-central:
assignee: nobody → doko
importance: Undecided → Medium
status: Unconfirmed → Needs Info
Dominic Durdan (ddurdan) wrote :

Install of launchpad-integration_0.1.10_all.deb update also returns errors after updating to python-central_0.5.12ubuntu3 which is listed as current.

apt-get terminal dump is attached.

Once again changing line 899 in /usr/bin/pycentral from:

 self.options.exclude, byte_compile_default=True)

to

 self.options.exclude, byte_compile_default=False)

and changing line 962 in /usr/bin/pycentral from

 pkg.remove(runtimes, remove_script_files=True)

to

 pkg.remove(runtimes, remove_script_files=False)

allows successful completion of this update. It's also important to note that neither apt, synaptic, or the update-manager will continue on after this error is thrown, this workaround allows the rest of the packages to continue to be installed. That terminal dump is also attached.

Dominic Durdan (ddurdan) wrote :
mneagul (mneagul) wrote :

I have the same problem, and I used the same quick-fix. Is there a permanent workaround ?

Dan Buch (meatballhat) wrote :

I first experienced this problem with the deskbar-applet package, but now I'm getting the same error with the gedit-plugins package. The weird part (I think?) is that gedit-plugins seems to have installed just fine - I just continue to receive this traceback whenever using apt-get:

Setting up gedit-plugins (2.18.0-0ubuntu1) ...
Traceback (most recent call last):
  File "/usr/bin/pycentral", line 1394, in <module>
    main()
  File "/usr/bin/pycentral", line 1388, in main
    rv = action.run(global_options)
  File "/usr/bin/pycentral", line 899, in run
    self.options.exclude, byte_compile_default=True)
  File "/usr/bin/pycentral", line 682, in install
    self.default_runtime.byte_compile(self.private_files, bc_option,
AttributeError: 'NoneType' object has no attribute 'byte_compile'
dpkg: error processing gedit-plugins (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 gedit-plugins
E: Sub-process /usr/bin/dpkg returned an error code (1)

William F Pearson (wfpearson) wrote :

I was affected by the bug too. The work around corrected the errors.

Dominic Durdan (ddurdan) wrote :

The wierd thing is that I can't find any byte compiling setting bits in any of the post or pre install scripts in the offending packages.

Dan Buch (meatballhat) wrote :

the workaround worked for me, too, btw :D

Nick Terry (j-nick-terry) wrote :

I believe the root of this problem is in /usr/bin/pyversions
It will incorrectly report the python version if the /usr/bin/python is not a symlink pointing to python*. Without this value python is unable to get the default_runtime and leaves it as None. Hence the error, AttributeError: 'NoneType' object has no attribute 'byte_compile'
A fix is posted in the comments to bug report 92287 that should fix this as well as any similar errors

Nick Terry (j-nick-terry) wrote :

Sorry about the hasty post. The pyversions fix I mentions previously does not completely fix the problem. The problem is the symlink but it breaks more pieces of python-central than just pyversions. The easiest fix I've found is to restore the expected directory structure.

ls -l /usr/bin/pyton
take note of your default
sudo rm /usr/bin/python
sudo ln -s python2.4 /usr/bin/python
replace python2.4 with you default. Notice, the lack of a path it is important

now when you ls -l the line should end with

/usr/bin/python -> python2.4

BTW: I am using edgy and the workaround did not work for me. Without the fix I am unable to uninstall any python packages and only install a few of them.

Matthias Klose (doko) wrote :

> Sorry about the hasty post. The pyversions fix I mentions previously does not completely fix the problem.
> The problem is the symlink but it breaks more pieces of python-central than just pyversions.
> The easiest fix I've found is to restore the expected directory structure.

yes, this is indeed the best thing to do. 0.5.61 is more robust in this regard. Closing this now as won't fix (detaching the other reports marked as duplicates)

Changed in python-central:
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers