Python — Pickle KeyError ‘\n’

I was getting this error when I was storing a UTF8 pickle in a database text field.

I fixed it by base64.b64encode(pickle.dumps(blah)), and saving that to the DB.

Leave a Comment