title: zipfile: how to set a password for a Zipfile?
body: <p>I have a zipfile in (sav.zip) and I'm trying to set a password for it:</p>
  <pre><code>zf = zipfile.ZipFile(&quot;sav.zip&quot;)
  zf.setpassword(&quot;1234&quot;)
  </code></pre>
  <p>but I get a <code>TypeError: expected Bytes, got str</code>.</p>
  <p>Where's my mistake?</p>