fedora-infra / pkgwat.api

Python API for querying the Fedora Packages webapp
http://pkgwat.rtfd.org
Other
9 stars 9 forks source link

`ValueError: No JSON object could be decoded` in several methods #22

Closed axilleas closed 9 years ago

axilleas commented 10 years ago

Hi! I was trying to fetch the dependencies of a package but the above error occurred every time (tried with several packages).

Basically, the same error happens for:

@ralphbean I just saw your comment in #5

This has exposed a bunch of bugs in the packages webapp around relationships.. most packages return 500 errors all over the place.

Could this be related?

Here's the full log:

In [19]: pkgwat.api.dependencies("pkgwat")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-19-877608bf8970> in <module>()
----> 1 pkg.dependencies("pkgwat")

/usr/lib/python2.7/site-packages/pkgwat/api/__init__.pyc in dependencies(package, arch, release, version, rows_per_page, start_row, strip_tags)
    677     }
    678 
--> 679     return _make_request(path, query, strip_tags)
    680 
    681 

/usr/lib/python2.7/site-packages/pkgwat/api/__init__.pyc in _make_request(path, query, strip_tags)
    138 
    139     if callable(d):
--> 140         d = d()
    141 
    142     if strip_tags:

/usr/lib/python2.7/site-packages/requests/models.pyc in json(self, **kwargs)
    649             if encoding is not None:
    650                 return json.loads(self.content.decode(encoding), **kwargs)
--> 651         return json.loads(self.text or self.content, **kwargs)
    652 
    653     @property

/usr/lib64/python2.7/json/__init__.pyc in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    336             parse_int is None and parse_float is None and
    337             parse_constant is None and object_pairs_hook is None and not kw):
--> 338         return _default_decoder.decode(s)
    339     if cls is None:
    340         cls = JSONDecoder

/usr/lib64/python2.7/json/decoder.pyc in decode(self, s, _w)
    363 
    364         """
--> 365         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    366         end = _w(s, end).end()
    367         if end != len(s):

/usr/lib64/python2.7/json/decoder.pyc in raw_decode(self, s, idx)
    381             obj, end = self.scan_once(s, idx)
    382         except StopIteration:
--> 383             raise ValueError("No JSON object could be decoded")
    384         return obj, end

ValueError: No JSON object could be decoded
pypingou commented 10 years ago

I wonder if this is not an oversight on the client as the server no longer provide this information: https://apps.fedoraproject.org/packages/guake

ralphbean commented 9 years ago

Yeah, we should just remove these bits from the client for the time being. Apologies @axilleas.

axilleas commented 9 years ago

Thanks @ralphbean