[Bug 1714960] Re: getArchiveSubscriptionURL() crashes on python3

Andy Whitcroft apw at canonical.com
Mon Jul 8 13:39:40 UTC 2019


Also seen in xenial.

** Also affects: lazr.restfulclient (Ubuntu Xenial)
   Importance: Undecided
       Status: New

** Changed in: lazr.restfulclient (Ubuntu Xenial)
       Status: New => In Progress

** Changed in: lazr.restfulclient (Ubuntu Xenial)
   Importance: Undecided => High

** Changed in: lazr.restfulclient (Ubuntu Xenial)
     Assignee: (unassigned) => Andy Whitcroft (apw)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to lazr.restfulclient in Ubuntu.
https://bugs.launchpad.net/bugs/1714960

Title:
  getArchiveSubscriptionURL() crashes on python3

Status in lazr.restfulclient:
  Fix Released
Status in lazr.restfulclient package in Ubuntu:
  Fix Released
Status in lazr.restfulclient source package in Xenial:
  In Progress

Bug description:
  When trying to use the me.getArchiveSubscriptionURL() call on Python
  3, an exception is generated:

  Traceback (most recent call last):
    File "./test.py", line 9, in <module>
      print(me.getArchiveSubscriptionURL(archive=ppa))
    File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 622, in __call__
      self.resource.lp_refresh()
    File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 759, in lp_refresh
      super(Entry, self).lp_refresh(new_url, etag)
    File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 346, 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 516, 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)

  The same code works fine on python2 (e.g. lp-shell). Because of this being broken, I'm unable to add some modification for ESM precise handling in our kernel review scripts as those are Python 3 based.
  Test-case:

  # Make sure you have a private PPA to which a subscription for the user is made
  from launchpadlib.launchpad import Launchpad
  PPA_LINK = '' # API link to the PPA here
  lp = Launchpad.login_with('test-broken-url', 'production', version='devel')
  ppa = lp.load(PPA_LINK)
  me = lp.load(lp.me.self_link)
  print(me.getArchiveSubscriptionURL(archive=ppa))

To manage notifications about this bug go to:
https://bugs.launchpad.net/lazr.restfulclient/+bug/1714960/+subscriptions



More information about the foundations-bugs mailing list