I would like to JSON encode some PDF and Excel files. I can read the content:
pdf = open("somefile.pdf", "rb").read() but now what? json.dumps() insists on treating it as a string to be interpreted as utf-8, and bytes == str in Python 2.x. I can't json.dumps() a bytearray. I can pickle the raw content and json.dumps that, but I can't guarantee the listener at the other end will be written in Python. Am I going to have to do something like base64-encode the raw bytes to transmit them? Thx, Skip -- https://mail.python.org/mailman/listinfo/python-list