Unpickling python2 datetime under python3
I chose to use pickle (+base64+TCP sockets) to communicate data between my python3 code and legacy python2 code, but I am having trouble with datetime objects: The PY3 object unpickles well on PY2, but the reverse raises a TypeError when calling the datetime constructor, then a UnicodeEncodeError in the load_reduce function. A short test program & the log, including dis output of both PY2 and PY3 pickles, are available in this gist I am using pickle.dumps(reply, protocol=2) in PY2 then pickle._loads(pickled, fix_imports=True, encoding='latin1') in PY3 (tried None and utf-8 without success)