Deserialisation "pickle" file
<p>My code is:</p>

<pre><code>import _pickle
with open('items_10000_matrix.pickle', 'rb') as f:
    data_new = _pickle.load(f)
</code></pre>

<p>But an error occurs: </p>

<pre><code>UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 212: ordinal not in range(128)
</code></pre>

<p>I am using windows 10 + python 3.5 with VS tools for python. </p>

<p>Try using <code>_pickle.load(f, encoding='bytes')</code>.</p>

<p>By the way, in Python 3, there's no reason to explicitly import <code>_pickle</code> rather than <code>pickle</code> because it will automatically switch to the C version if it's available. See the accepted answer to the question <a href="http://stackoverflow.com/questions/19191859/what-difference-between-pickle-and-pickle-in-python-3"><em>What difference between pickle and _pickle in python 3?</em></a></p>

python python-3.x pickle python-unicode