On 5/18/2010 3:10 AM, Peter Otten wrote:
Now simulate the effect of writing in text mode and reading in binary mode:
>>> garbled_data = data.replace("\n", "\r\n")
>>> pickle.loads(garbled_data)
Traceback (most recent call last):
...
ImportError: No module named collections
>>> try: pickle.loads(garbled_data)
... except ImportError as e:
... e
...
ImportError('No module named collections\r',)
Nice catch, Peter. I filed a request that the message quote the name it
cannot import, so that the OP would have seen the more informative
ImportError: No module named 'collections\r'
http://bugs.python.org/issue8754
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list