title: How to open a csv in a zip in a zip with python?
body: <p>I have been using a user-defined function to open CSV files contained within a ZIP file, which has been working very well for me. </p>
  
  <p><a href="https://stackoverflow.com/questions/48843761/how-to-scrape-csv-files-from-a-url-when-they-are-saved-in-a-zip-file-in-pytho/48844157?noredirect=1#comment88976276_48844157">How to scrape .csv files from a url, when they are saved in a .zip file in Python?</a></p>
  
  <p>Now I am trying to open a CSV file which is contained within a ZIP, which is contained in another ZIP, and have run into some trouble. </p>
  
  <p>Instead of getting the expected output of a dataframe with the data from a CSV, I am getting this error:</p>
  
  <pre><code>UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfd in position 0: invalid start byte
  </code></pre>
  
  <p>which sort of makes sense because I am trying to open a zip file with <code>read_csv()</code></p>
  
  <pre><code>import pandas as pd
  
  def fetch_multi_csv_zip_from_url(url, filenames=(), *args, **kwargs):
      assert kwargs.get('compression') is None
      req = urlopen(url)
      zip_file = zipfile.ZipFile(BytesIO(req.read()))
  
      if filenames:
          names = zip_file.namelist()
          for filename in filenames:
              if filename not in names:
                  raise ValueError(
                      'filename {} not in {}'.format(filename, names))
      else:
          filenames = zip_file.namelist()
  
      return {name: pd.read_csv(zip_file.open(name), *args, **kwargs)
              for name in filenames}
  
  try:
      from urllib.request import urlopen
  except ImportError:
      from urllib2 import urlopen
  from io import BytesIO
  import zipfile
  
  final_links_list =['http://www.nemweb.com.au/REPORTS/ARCHIVE/Dispatch_SCADA/PUBLIC_DISPATCHSCADA_20170523.zip', 'http://www.nemweb.com.au/REPORTS/ARCHIVE/Dispatch_SCADA/PUBLIC_DISPATCHSCADA_20170524.zip']
  l = len(final_links_list)
  
  for j in range(0,l):
      print(j)
      dfs = fetch_multi_csv_zip_from_url(final_links_list[j])
  </code></pre>
  
  <p>This is the code that I have been using, and I gather that I have to change the line starting with:</p>
  
  <pre><code>return {name: pd.read_csv(zip_file.open(name)
  </code></pre>
  
  <p>as it no longer returns a csv file, but a zip file. </p>