"UnicodeDecodeError: 'charmap' codec can't decode" error in pickle load
<p>I am trying to save an array of Tweet objects in file. Tweet class instances contain utf8 encoding characters. you can see the code below:</p>

<pre><code>class Tweet:
    author='';
    text='';
    time='';
    date='';
    timestamp='';

with open('tweets.dat','wb') as f:
     pickle.dump(all_tweets,f)

with open('tweets.dat') as f:
   all_tweets = pickle.load(f)
</code></pre>

<p>When I run the code, it returns an exception on <em>pickle.load(f)</em> line stating that :</p>

<pre><code>UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 25: character maps to &lt;undefined&gt;
</code></pre>

<p>My machine specification:</p>

<blockquote>
  <p>Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  5 2016,
  11:41:13) [MSC v.1900 64 bit (AMD64)] on win32</p>
</blockquote>