Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bandit's get_jobs method throws error #2

Open
hernamesbarbara opened this issue Dec 28, 2016 · 1 comment
Open

bandit's get_jobs method throws error #2

hernamesbarbara opened this issue Dec 28, 2016 · 1 comment

Comments

@hernamesbarbara
Copy link

Expected:

  • running bandit.get_jobs() with no arguments should return a python list of job names my user has access to in the UI

Observed

In [40]: bandit.get_jobs()
---------------------------------------------------------------------------
JSONDecodeError                           Traceback (most recent call last)
<ipython-input-40-270c11c54d58> in <module>()
----> 1 bandit.get_jobs()

/usr/local/lib/python2.7/site-packages/bandit/bandit.pyc in get_jobs(self)
     73         """
     74         r = requests.get(self.url + "/jobs", auth=(self.username, self.apikey))
---> 75         jobs = r.json()['jobs']
     76         return [Job(**j) for j in jobs]
     77

/usr/local/lib/python2.7/site-packages/requests/models.pyc in json(self, **kwargs)
    824                     # used.
    825                     pass
--> 826         return complexjson.loads(self.text, **kwargs)
    827
    828     @property

/usr/local/lib/python2.7/site-packages/simplejson/__init__.pyc in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, use_decimal, **kw)
    514             parse_constant is None and object_pairs_hook is None
    515             and not use_decimal and not kw):
--> 516         return _default_decoder.decode(s)
    517     if cls is None:
    518         cls = JSONDecoder

/usr/local/lib/python2.7/site-packages/simplejson/decoder.pyc in decode(self, s, _w, _PY3)
    372         if _PY3 and isinstance(s, binary_type):
    373             s = s.decode(self.encoding)
--> 374         obj, end = self.raw_decode(s)
    375         end = _w(s, end).end()
    376         if end != len(s):

/usr/local/lib/python2.7/site-packages/simplejson/decoder.pyc in raw_decode(self, s, idx, _w, _PY3)
    402             elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
    403                 idx += 3
--> 404         return self.scan_once(s, idx=_w(s, idx).end())

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@glamp
Copy link
Contributor

glamp commented Dec 28, 2016

fixed. try 0.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants