code: def repair_central_directory(zipFile, is_file_instance): # source: https://bitbucket.org/openpyxl/openpyxl/src/93604327bce7aac5e8270674579af76d390e09c0/openpyxl/reader/excel.py?at=default&fileviewer=file-view-default
      ''' trims trailing data from the central directory
      code taken from http://stackoverflow.com/a/7457686/570216, courtesy of Uri Cohen
      '''
      f = zipFile if is_file_instance else open(zipFile, 'rb+')
      data = f.read()
      pos = data.find(CENTRAL_DIRECTORY_SIGNATURE)  # End of central directory signature
      if (pos > 0):
          sio = BytesIO(data)
          sio.seek(pos + 22)  # size of 'ZIP end of central directory record'
          sio.truncate()
          sio.seek(0)
          return sio
  
      f.seek(0)
      return f repair_central_directory(zipFile, is_file_instance): # source: https://bitbucket.org/openpyxl/openpyxl/src/93604327bce7aac5e8270674579af76d390e09c0/openpyxl/reader/excel.py?at=default&fileviewer=file-view-default
      ''' trims trailing data from the central directory
      code taken from http://stackoverflow.com/a/7457686/570216, courtesy of Uri Cohen
      '''
      f = zipFile if is_file_instance else open(zipFile, 'rb+')
      data = f.read()
      pos = data.find(CENTRAL_DIRECTORY_SIGNATURE)  # End of central directory signature
      if (pos > 0):
          sio = BytesIO(data)
          sio.seek(pos + 22)  # size of 'ZIP end of central directory record'
          sio.truncate()
          sio.seek(0)
          return sio
  
      f.seek(0)
      return f
docs: trims trailing data from the central directory
      code taken from http://stackoverflow.com/a/7457686/570216, courtesy of Uri Cohen