title: How to check if zipfile is not already closed
body: <p>What is the best way in Python to check if a ZipFile object is not already closed?</p>
  
  <p>For the moment I am doing this in a class:</p>
  
  <pre><code>try:
      self.zf.open(archive_name).close()
  except RuntimeError:
      self.zf = zipfile.ZipFile(self.path)
  
  with self.zf.open(archive_name) as f: 
      # do stuff...
  </code></pre>
  
  <p>Is there a better way?</p>