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

json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1) #28

Closed
cr0n-dist0rti0n opened this issue Mar 8, 2020 · 6 comments
Assignees
Labels

Comments

@cr0n-dist0rti0n
Copy link

*** Error Output Below ***

File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 353, in raw_decode
  obj, end = self.scan_once(s, idx)

builtins.StopIteration: 1

During handling of the above exception, another exception occurred:

 File "/dowload_questrade_data/questrade/questrade_play.py", line 4, in <module>
  q = Questrade(refresh_token='<my token code>')
File "/usr/local/lib/python3.7/site-packages/questrade_api/questrade.py", line 22, in __init__
  self.auth = Auth(**auth_kwargs, config=self.config)
File "/usr/local/lib/python3.7/site-packages/questrade_api/auth.py", line 20, in __init__
  self.__refresh_token(kwargs['refresh_token'])
File "/usr/local/lib/python3.7/site-packages/questrade_api/auth.py", line 39, in __refresh_token
  token = json.loads(r.read().decode('utf-8'))
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
  return _default_decoder.decode(s)
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
  obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode
  raise JSONDecodeError("Expecting value", s, err.value) from None

json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)

*** From 'decoder.py' ***

  def raw_decode(self, s, idx=0):
       """Decode a JSON document from ``s`` (a ``str`` beginning with
       a JSON document) and return a 2-tuple of the Python
       representation and the index in ``s`` where the document ended.

       This can be used to decode a JSON document from a string that may
       have extraneous data at the end.

       """
       try:
           obj, end = self.scan_once(s, idx)
       except StopIteration as err:
           raise JSONDecodeError("Expecting value", s, err.value) from None
       return obj, end

Issue with line 355: raise JSONDecodeError("Expecting value", s, err.value) from None

@jborchma
Copy link
Owner

jborchma commented Mar 8, 2020

Hey! Thanks for flagging this issue. Could you provide a minimal example for this error?

@jborchma jborchma self-assigned this Mar 8, 2020
@jborchma jborchma added the bug label Mar 8, 2020
@jborchma
Copy link
Owner

jborchma commented Mar 8, 2020

Also, it looks like you're using a different package?

@cr0n-dist0rti0n
Copy link
Author

cr0n-dist0rti0n commented Mar 9, 2020 via email

@jborchma
Copy link
Owner

jborchma commented Mar 9, 2020

So, I can't reproduce your error. For me, it works fine. Are you sure you're using the right token?

@jborchma
Copy link
Owner

Any update from your side? Everything is still working fine for me.

@jborchma
Copy link
Owner

Ok, I am going to close this for now. Please update if you have something else coming up.

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

No branches or pull requests

2 participants