title: Python Zipfile compression method is not supported
body: <p>The times when this worked were when I used ZIPCrypto compression. It's with AES-256 that it fails. How to get around this please?</p>
  <p>I previously had success using the following Python code to open a password protected .zip file created with 7-Zip:</p>
  <pre><code>import zipfile
  
  zip_file = zipfile.ZipFile('crack_me.zip')
  output_verbose = 1  # increase that for long password list
  with open('passwords.txt', 'rb') as password_list:
      for index, line in enumerate(password_list):
          try:
              pwd = line.strip(b'\r\n')
              zip_file.extractall(pwd=pwd)
          except RuntimeError as e:
              print(e)
              if index % output_verbose == 0:
                  print('{}. The {} word not matched.'.format(index + 1, pwd))
          else:
              print('{}. Wow ! found the password: {}'.format(index + 1, pwd))
              break
  
  zip_file.close()
  </code></pre>
  <p>However, for no understandable reason, it has only worked a couple of times out of many attempts. Most times is gives &quot;That compression method is not supported&quot; for the exception.</p>
  <p>I've tried deleting, renaming, re-creating the .zip file but no success. It makes no sense to me that it works occasionally.</p>
  <p>I tried to simplify the issue as below:</p>
  <pre><code>import zipfile
  
  zip_file = zipfile.ZipFile('crack_me.zip')
  try:
      zip_file.extractall(pwd=b&quot;password&quot;)
      print('Opened')
  except RuntimeError as e:
      print(e)
  </code></pre>
  <p>But I get the same exception. I've tried variations of <code>pwd</code> such as bytes(&quot;password&quot;, &quot;utf-8) and others.</p>
  <p>The provided password opens the .zip file when opening with 7-Zip.</p>
  <p>What is going on here please?</p>