I am accepting some binary data from a websocket.
I am trying to do json.loads(data)
however I get a ValueError
thrown
Printing it I get the following result (which is all valid json):
{"session":"SeFKQ0SfYZqhh6FTCcKZGw==","authenticate":1,"id":1791}
but when I inspected the string further, the print
was turning this monstrosity into the json above:
'{\x00"\x00s\x00e\x00s\x00s\x00i\x00o\x00n\x00"\x00:\x00"\x00S\x00e
\x00F\x00K\x00Q\x000\x00S\x00f\x00Y\x00Z\x00q\x00h\x00h\x006\x00F
\x00T\x00C\x00c\x00K\x00Z\x00G\x00w\x00=\x00=\x00"\x00,\x00"\x00a
\x00u\x00t\x00h\x00e\x00n\x00t\x00i\x00c\x00a\x00t\x00e\x00"\x00:
\x001\x00,\x00"\x00t\x00h\x00r\x00e\x00a\x00d\x00_\x00i\x00d\x00"
\x00:\x001\x007\x009\x001\x00}\x00'
What is this coming back and how can I do something meaningful (turning it into a native dictionary via json.loads
) with it?