title: What causes the error "_pickle.UnpicklingError: invalid load key, ' '."?
body: <p>I'm trying to store 5000 data elements on an array. This 5000 elements are stored on an existinng file (therefore it's not empty).</p>
  <p>But I'm getting an error.</p>
  <p>IN:</p>
  <pre><code>def array():
  
      name = 'puntos.df4'
  
      m = open(name, 'rb')
      v = []*5000
  
      m.seek(-5000, io.SEEK_END)
      fp = m.tell()
      sz = os.path.getsize(name)
  
      while fp &lt; sz:
          pt = pickle.load(m)
          v.append(pt)
  
      m.close()
      return v
  </code></pre>
  <p>OUT:</p>
  <pre><code>line 23, in array
  pt = pickle.load(m)
  _pickle.UnpicklingError: invalid load key, ''.
  </code></pre>