[py3] bug.subscribe() crashes with simplejson.scanner.JSONDecodeError

Bug #1425627 reported by Martin Pitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lazr.restfulclient (Ubuntu)
New
Undecided
Colin Watson

Bug Description

While porting Apport to python 3 I stumbled over this exception:

bzr branch lp:apport
cd apport
ln -s ../backends/packaging-apt-dpkg.py apport/packaging_impl.py
# work around bug 1425575
wget -O- http://people.canonical.com/~pitti/tmp/apport.workaround-1425575.patch | patch -p1
PYTHONPATH=. python3 apport/crashdb_impl/launchpad.py -v _T.test_2_update_traces

crashes with

ERROR: test_2_update_traces (__main__._T)
update_traces()
----------------------------------------------------------------------
Traceback (most recent call last):
  File "apport/crashdb_impl/launchpad.py", line 1329, in test_2_update_traces
    self.crashdb.update_traces(self.get_segv_report(), r, 'good retrace!')
  File "apport/crashdb_impl/launchpad.py", line 471, in update_traces
    self._subscribe_triaging_team(bug, report)
  File "apport/crashdb_impl/launchpad.py", line 930, in _subscribe_triaging_team
    bug.subscribe(person=person)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 623, in __call__
    self.resource.lp_refresh()
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 760, in lp_refresh
    super(Entry, self).lp_refresh(new_url, etag)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 347, in lp_refresh
    representation, self.JSON_MEDIA_TYPE)
  File "/usr/lib/python3/dist-packages/wadllib/application.py", line 363, in bind
    representation_definition)
  File "/usr/lib/python3/dist-packages/wadllib/application.py", line 300, in __init__
    _make_unicode(representation))
  File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 505, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Unfortunately I wasn't able to come up with a simple reproducer script for this. Something like

bug = lp.bugs[123456]
person = '%s~ubuntu-crashes-universe' % lp._root_uri
bug.subscribe(person=person)

works fine, so there must be some more internal state keeping which messes this up. Please let me know if you need a simpler reproducer for this, then I'll try harder.

Revision history for this message
Martin Pitt (pitti) wrote :

This is my attempt at reproducing, which already became reasonably complicated... So for now reproducing with apport's test suite should work.

Changed in lazr.restfulclient (Ubuntu):
assignee: nobody → Dimitri John Ledkov (xnox)
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Sorry don't have time for this. Colin / William - do you have at all time to poke/sweep launchpadlib* deps for python3 issues? It would be great to have a reasonably functional python3 launchpadlib in xenial.

Changed in lazr.restfulclient (Ubuntu):
assignee: Dimitri John Ledkov (xnox) → nobody
assignee: nobody → Colin Watson (cjwatson)
Revision history for this message
Colin Watson (cjwatson) wrote :

I didn't notice this before fixing bug 1714960, but they're the same thing.

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.