The zaqar.transport.utils module¶
-
exception
MalformedJSON¶ Bases:
exceptions.ValueErrorJSON string is not valid.
-
exception
OverflowedJSONInteger¶ Bases:
exceptions.OverflowErrorJSON integer is too large.
-
read_json(stream, len)¶ Like json.load, but converts ValueError to MalformedJSON upon failure.
Parameters: - stream – a file-like object
- len – the number of bytes to read from stream
-
to_json(obj)¶ Like json.dumps, but outputs a UTF-8 encoded string.
Parameters: obj – a JSON-serializable object