You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run this code in a loop to constantly scan for opportunities with my bot. 90% of the time after 5 min my code ends in an error like this:
File "tradeKraken.py", line 34, in
balances = k.query_private('Balance')
File "/usr/local/var/pyenv/versions/3.4.3/bin/krakenex/api.py", line 122, in query_private
return self._query(urlpath, req, conn, headers)
File "/usr/local/var/pyenv/versions/3.4.3/bin/krakenex/api.py", line 83, in _query
return json.loads(ret)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
any ideas?
The text was updated successfully, but these errors were encountered:
I ended up using this
def is_json(myjson):
try:
json_object = json.loads(myjson)
except ValueError, e:
return False
return True
if is_json(ret):
return json.loads(ret)
else:
time.sleep(30)
print "got here"
return json.loads(ret)
but not sure how long to pause it. probable "a few minutes" like it says in the html?
I run this code in a loop to constantly scan for opportunities with my bot. 90% of the time after 5 min my code ends in an error like this:
File "tradeKraken.py", line 34, in
balances = k.query_private('Balance')
File "/usr/local/var/pyenv/versions/3.4.3/bin/krakenex/api.py", line 122, in query_private
return self._query(urlpath, req, conn, headers)
File "/usr/local/var/pyenv/versions/3.4.3/bin/krakenex/api.py", line 83, in _query
return json.loads(ret)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
any ideas?
The text was updated successfully, but these errors were encountered: