From 7869eba7cd9a9dee3055ee3050f2b4951d13b59d 2011-11-24 18:50:10 From: Fernando Perez Date: 2011-11-24 18:50:10 Subject: [PATCH] Read pickles in pure binary mode. In 4ab240d53a we changed to pickle protocol 2 that introduces more binary data, so trying to read back those pickles in 'U' mode will cause strange unpickling errors. --- diff --git a/IPython/utils/pickleshare.py b/IPython/utils/pickleshare.py index e68d1fe..be5cd04 100755 --- a/IPython/utils/pickleshare.py +++ b/IPython/utils/pickleshare.py @@ -67,7 +67,7 @@ class PickleShareDB(collections.MutableMapping): return self.cache[fil][0] try: # The cached item has expired, need to read - obj = pickle.loads(fil.open("rbU").read()) + obj = pickle.loads(fil.open("rb").read()) except: raise KeyError(key)