get-distro-upgrade.py needs to be converted to python3

Bug #1246539 reported by Serhiy
46
This bug affects 8 people
Affects Status Importance Assigned to Milestone
packagekit (Ubuntu)
Fix Released
Medium
Unassigned
Trusty
Fix Released
Medium
Unassigned

Bug Description

The report appeared after upgrading from 13.04 to 13.10

ProblemType: Crash
DistroRelease: Ubuntu 13.10
Package: packagekit-backend-aptcc 0.8.10-2ubuntu2
ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
Uname: Linux 3.11.0-12-generic i686
NonfreeKernelModules: nvidia
ApportVersion: 2.12.5-0ubuntu2.1
Architecture: i386
Date: Thu Oct 31 02:52:59 2013
ExecutablePath: /usr/share/PackageKit/helpers/aptcc/get-distro-upgrade.py
InterpreterPath: /usr/bin/python2.7
MarkForUpload: True
ProcCmdline: python /usr/share/PackageKit/helpers/aptcc/get-distro-upgrade.py get-distro-upgrades
ProcEnviron: LANG=en_US.UTF-8
PythonArgs: ['/usr/share/PackageKit/helpers/aptcc/get-distro-upgrade.py', 'get-distro-upgrades']
SourcePackage: packagekit
Title: get-distro-upgrade.py crashed with ImportError in __main__: No module named packagekit.backend
Traceback:
 Traceback (most recent call last):
   File "/usr/share/PackageKit/helpers/aptcc/get-distro-upgrade.py", line 24, in <module>
     from packagekit.backend import *
 ImportError: No module named packagekit.backend
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

Revision history for this message
Serhiy (xintx-ua) wrote :
tags: removed: need-duplicate-check
Changed in packagekit (Ubuntu):
importance: Undecided → Medium
Serhiy (xintx-ua)
information type: Private → Public
Revision history for this message
Benedykt 'Silmethule' Jaworski (silmethule) wrote :

Happens also on Kubuntu 13.10 for amd64.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in packagekit (Ubuntu):
status: New → Confirmed
Revision history for this message
Brian Murray (brian-murray) wrote :

It looks like packagekit-backend-aptcc is called with python2.7 but the packagekit.backend code is python3.

Changed in packagekit (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Brian Murray (brian-murray) wrote :
summary: - get-distro-upgrade.py crashed with ImportError in __main__: No module
- named packagekit.backend
+ get-distro-upgrade.py needs to be converted to python3
Revision history for this message
Craig Gowing (credativ) (craiggowing) wrote :

I got this error pop up around 4 times every login on Kubuntu 13.10 amd64 (upgraded), and then at random intervals after that.

Oddly on my other Kubuntu 13.10 amd64 box (again upgraded) this module is available for python 2.7:
>>> import packagekit.backend
>>> packagekit.backend
<module 'packagekit.backend' from '/usr/lib/python2.7/dist-packages/packagekit/backend.pyc'>

The py files on my working box were in /usr/share/pyshared/packagekit and symlinked to /usr/lib/python2.7/dist-packages/packagekit.
They must have come from some old package that was removed during the upgrade but preserved the files I guess?

I tested out two possible workarounds and they both seemed to work:

1. Modify /usr/share/PackageKit/helpers/aptcc/get-distro-upgrade.py and change the first line to:
#!/usr/bin/env python3

2. Copy over /usr/share/pyshared/packagekit/ from my working box and symlink the py files to /usr/lib/python2.7/dist-packages/packagekit/

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Fixed committed as part of removing python2.7 from ubuntu touch images:

packagekit (0.8.12-1ubuntu3) trusty; urgency=medium

  * Change p-b-aptcc backend helper shebang from python2 to python3. (LP:
    #1283574)
 -- Dimitri John Ledkov <email address hidden> Mon, 24 Feb 2014 17:12:52 +0000

Changed in packagekit (Ubuntu Trusty):
status: Triaged → Fix Committed
Revision history for this message
Matthias Klumpp (ximion) wrote :

I will apply this upstream as well... (I wonder why this hasn't been the case yet... Maybe because python-packagekit wasn't fully ported)

Changed in packagekit (Ubuntu Trusty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.