python-launchpadlib is missing python-simplejson dependency

Bug #510129 reported by Scott Moser
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
python-launchpadlib (Debian)
Fix Released
Unknown
python-launchpadlib (Ubuntu)
Fix Released
High
Martin Pitt

Bug Description

Binary package hint: apport

running 'apport-cli' in current ec2 instance results in:
$ apport-cli
Could not import module, is a package upgrade in progress? Error: No module named simplejson

This is fixed by:
  apt-get install python-simplejson

I modified /usr/lib/python2.6/dist-packages/apport/ui.py to raise the exception rather than catching it and printing out the above message and here is the traceback:

  File "/usr/bin/apport-cli", line 403, in <module>
    app = CLIUserInterface()
  File "/usr/bin/apport-cli", line 122, in __init__
    apport.ui.UserInterface.__init__(self)
  File "/usr/lib/python2.6/dist-packages/apport/ui.py", line 131, in __init__
    self.crashdb = get_crashdb(None)
  File "/usr/lib/python2.6/dist-packages/apport/crashdb.py", line 538, in get_crashdb
    m = __import__('apport.crashdb_impl.' + db['impl'], globals(), locals(), ['CrashDatabase'])
  File "/usr/lib/python2.6/dist-packages/apport/crashdb_impl/launchpad.py", line 18, in <module>
    from launchpadlib.launchpad import Launchpad, STAGING_SERVICE_ROOT, EDGE_SERVICE_ROOT
  File "/usr/lib/pymodules/python2.6/launchpadlib/launchpad.py", line 31, in <module>
    from lazr.restfulclient._browser import RestfulHttp
  File "/usr/lib/pymodules/python2.6/lazr/restfulclient/_browser.py", line 39, in <module>
    import simplejson
ImportError: No module named simplejson

In short, I think that python-apport is missing a dependency on python-simplejson

ProblemType: Bug
Architecture: i386
CrashReports: 600:1000:1000:7295:2010-01-20 14:27:32.000000000 +0000:2010-01-20 14:28:16.000000000 +0000:/var/crash/_usr_bin_apport-cli.1000.crash
Date: Wed Jan 20 14:29:16 2010
DistroRelease: Ubuntu 10.04
Ec2AMI: ami-1b7d9072
Ec2AMIManifest: ubuntu-images-testing-us/ubuntu-lucid-daily-i386-server-20100120.manifest.xml
Ec2AvailabilityZone: us-east-1d
Ec2InstanceType: m1.small
Ec2Kernel: aki-60cb2609
Ec2Ramdisk: ari-537d903a
Package: python-apport 1.11-0ubuntu5 [modified: usr/share/pyshared/apport/ui.py]
PackageArchitecture: all
ProcEnviron:
 SHELL=/bin/bash
 LANG=en_US.UTF-8
ProcVersionSignature: User Name 2.6.32-301.4-ec2
SourcePackage: apport
Tags: lucid ec2-images
Uname: Linux 2.6.32-301-ec2 i686

Revision history for this message
Scott Moser (smoser) wrote :
Changed in apport (Ubuntu):
importance: Undecided → High
Revision history for this message
Martin Pitt (pitti) wrote :

Apport itself doesn't need simplejson, but launchpadlib does. ATM it

  Depends: python-simplejson | python (>= 2.6)

which is insufficient. It needs to drop the | python bit.

Python 2.6 does have a builtin json parser, but it has a different module name at least (and perhaps also a different API).

affects: apport (Ubuntu) → python-launchpadlib (Ubuntu)
Changed in python-launchpadlib (Ubuntu):
status: New → Triaged
summary: - python-apport is missing python-simplejson dependency
+ python-launchpadlib is missing python-simplejson dependency
Martin Pitt (pitti)
Changed in python-launchpadlib (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-launchpadlib - 1.5.4-1ubuntu1

---------------
python-launchpadlib (1.5.4-1ubuntu1) lucid; urgency=low

  * debian/control: Always depend on python-simplejson, drop the alternative
    "python2.6" dependency. While python2.6 also ships a json module, it has
    at least a different module name, and possibly even a different API.
    (LP: #510129)
 -- Martin Pitt <email address hidden> Mon, 25 Jan 2010 09:07:10 +0100

Changed in python-launchpadlib (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Forwarded to Debian as well, I'll link the bug number once it's created.

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 510129] Re: python-launchpadlib is missing python-simplejson dependency

On Mon, 25 Jan 2010 08:10:09 -0000, Launchpad Bug Tracker <email address hidden> wrote:
> This bug was fixed in the package python-launchpadlib - 1.5.4-1ubuntu1
>
> ---------------
> python-launchpadlib (1.5.4-1ubuntu1) lucid; urgency=low
>
> * debian/control: Always depend on python-simplejson, drop the alternative
> "python2.6" dependency. While python2.6 also ships a json module, it has
> at least a different module name, and possibly even a different API.
> (LP: #510129)

I believe it has the same API, I've seen code that does

try:
  import json
except ImportError:
  import simplejson as json

and then uses json throughout.

Thanks for fixing this though.

James

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

James Westby ha scritto:
> try:
> import json
> except ImportError:
> import simplejson as json

Yes, it works in many circumstances, at least at those I saw so far.

In this case, code could become:
try:
    import json as simplejson
except ImportError:
    import simplejson

Maybe upstream is interested in using that.

Changed in python-launchpadlib (Debian):
status: Unknown → Fix Committed
Changed in python-launchpadlib (Debian):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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