I have a large object that is read from a binary using struct.unpack, and some of the values ββare arrays of characters that are considered bytes.
Since character arrays in Python 3 are read as bytes instead of strings (for example, in Python 2), they cannot be directly passed to json.dumps, because "bytes" are not serializable JSON.
Is there a way to go from the decompressed structure to json without searching through each value and converting bytes to strings?
source share