title: Python - Error opening pickle file created with job lib
body: <p>I've inherited a dataset stored in a pickle file, which was to the best of my knowledge, created in python 3.</p>
  
  <p>I am trying to open the pickle file in python using the following code:</p>
  
  <pre><code>f = open('file.pkl', 'rb')
  cl = pickle.loads(f)
  </code></pre>
  
  <p>When I do so, I get the following error:</p>
  
  <pre><code>TypeError: a bytes-like object is required, not '_io.BufferedReader'
  </code></pre>
  
  <p>A similar error is thrown when I try to read it in with only an <code>'r'</code> argument.</p>
  
  <p>I can see that the pickel file has been created with joblib, which I have never used before. I can't find any documentation saying if joblib pickel files need to be opened a different way.</p>
  
  <p>Here is the code to create the pickle file:</p>
  
  <pre><code>joblib.dump(list_of_dataframes, 'file.pkl', compress=3)
  </code></pre>
  
  <p>Any help is greatly appreciated!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This also won't open when I try to load directly from <code>joblib</code>:</p>
  
  <pre><code>with open(pickle_file) as f:
      data = joblib.load(f)
  </code></pre>
  
  <p>Which throws the following error:</p>
  
  <pre><code>UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte
  </code></pre>