error in KiteError

sameer
Please check this error I got in Kite connect 3.7.0 in KiteTicker

File "/home/ubuntu/.local/lib/python3.5/site-packages/kiteconnect/ticker.py", line 71, in onMessage
self.factory.on_message(self, payload, is_binary)
File "/home/ubuntu/.local/lib/python3.5/site-packages/kiteconnect/ticker.py", line 649, in _on_message
self._parse_text_message(payload)
File "/home/ubuntu/.local/lib/python3.5/site-packages/kiteconnect/ticker.py", line 673, in _parse_text_message
data = json.loads(payload)
File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
builtins.TypeError: the JSON object must be str, not 'bytes'
Tagged:
  • sameer
    ERROR:kiteconnect.ticker:WebSocket connection lost: [Failure instance: Traceback: : the JSON object must be str, not 'bytes'
  • sujith
    We will check and get back to you.
  • Vivek
    @sameer Can you please update package and check. I have added few Python 3 related fixes

    pip install kiteconnect --upgrade --pre
  • sameer
    Thanks @vivek ... will check
  • sameer
    @vivek again I got error today
    builtins.TypeError: the JSON object must be str, not 'bytes'


    self.onMessageEnd()
    File "/home/ubuntu/.local/lib/python3.5/site-packages/autobahn/websocket/protocol.py", line 627, in onMessageEnd
    self._onMessage(payload, self.message_is_binary)
    File "/home/ubuntu/.local/lib/python3.5/site-packages/autobahn/twisted/websocket.py", line 162, in _onMessage
    self.onMessage(payload, isBinary)
    File "/home/ubuntu/.local/lib/python3.5/site-packages/kiteconnect/ticker.py", line 71, in onMessage
    self.factory.on_message(self, payload, is_binary)
    File "/home/ubuntu/.local/lib/python3.5/site-packages/kiteconnect/ticker.py", line 649, in _on_message
    self._parse_text_message(payload)
    File "/home/ubuntu/.local/lib/python3.5/site-packages/kiteconnect/ticker.py", line 673, in _parse_text_message
    data = json.loads(payload)
    File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
    builtins.TypeError: the JSON object must be str, not 'bytes'

  • sameer
    ERROR:kiteconnect.ticker:WebSocket connection lost: [Failure instance: Traceback: : the JSON object must be str, not 'bytes'
    /home/ubuntu/.local/lib/python3.5/site-packages/twisted/python/log.py:86:callWithContext
  • Vivek
    @sameer Can you please post full logs again. Because if you have updated then any exception in that like (ticker.py line 677) wont be raised.
  • sameer
    @vivek I don't have logs ... if it gets reproduced, I will post log
Sign In or Register to comment.