[py3] getSourcePackage() crashes with ValueError: Expecting value: line 1 column 1 (char 0)

Bug #1403524 reported by Martin Pitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lazr.restfulclient (Ubuntu)
Fix Released
Critical
Dimitri John Ledkov

Bug Description

With python3-launchpadlib, the getSourcePackage() API call fails:

$ python3 ~/test.py
distro: https://api.staging.launchpad.net/1.0/ubuntu
Traceback (most recent call last):
  File "/home/martin/test.py", line 8, in <module>
    pkg = ubuntu.getSourcePackage(name='coreutils')
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 621, in __call__
    return self._handle_200_response(url, response, content)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 656, in _handle_200_response
    document = loads(text_type(content))
  File "/usr/lib/python3.4/json/__init__.py", line 318, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode
    raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 1 column 1 (char 0)

With python-launchpadlib (py2) it works fine:

$ python ~/test.py
('distro:', <distribution at https://api.staging.launchpad.net/1.0/ubuntu>)
('pkg:', <distribution_source_package at https://api.staging.launchpad.net/1.0/ubuntu/+source/coreutils>)

Revision history for this message
Martin Pitt (pitti) wrote :
affects: python-launchpadlib (Ubuntu) → lazr.restfulclient (Ubuntu)
Changed in lazr.restfulclient (Ubuntu):
assignee: nobody → Dimitri John Ledkov (xnox)
status: New → Triaged
importance: Undecided → Critical
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lazr.restfulclient - 0.13.4-3

---------------
lazr.restfulclient (0.13.4-3) experimental; urgency=medium

  * Fix json loads (LP: #1403524).

 -- Dimitri John Ledkov <email address hidden> Wed, 21 Jan 2015 18:58:46 +0000

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

Other bug subscribers

Bug attachments

Remote bug watches

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