title: Errno 22 invalid mode ('rb') while unzip a zip from url using python
body: <p>I'm trying to unzip the file from an URL, and stuck with the below Error. I
  would get the URL's dynamic so the path may keep vary.</p>
  
  <p>[Errno 22] invalid mode ('rb') or filename: '<a href="http://example.com/media/example.zip" rel="nofollow noreferrer">http://example.com/media/example.zip</a>'</p>
  
  <pre><code>    url = r"http://" + request.get_host() + uploaded_file_url
      with zipfile.ZipFile(url, "r") as zip_ref:
          zip_ref.extractall("c:/tmp")
          zip_ref.namelist()
  </code></pre>
  
  <p>The above is the piece of code that i use for unzip. As per my understanding expected is to pass the escape character so that it can read url "<a href="https://stackoverflow.com/questions/15598160/ioerror-errno-22-invalid-mode-r-or-filename-c-python27-test-txt?answertab=oldest#tab-top">IOError: [Errno 22] invalid mode (&#39;r&#39;) or filename: &#39;c:\\Python27\test.txt&#39;</a>"</p>
  
  <p>How we can do this for URL.</p>