title: How do I close files in python when I haven't got the file identifiers
body: <p>I found myself unable to open new files in Python. When I examined with <code>ls -l /proc/PID/fd</code> I saw loads of files open for the Python process. The module I am using is apparently opening lots of files and not closing them.</p>
  
  <p>I was expecting that I could close the files by deleting objects associated with the module that opened the files, but nothing happened. </p>
  
  <p>I was also expecting to see the file objects somewhere in the garbage collection, but I saw nothing that resembled the open files with this: </p>
  
  <pre><code>for obj in gc.get_objects():
      if hasattr(obj, 'read'):
          print(obj)
  </code></pre>
  
  <p>The files disappear when I quit Python.</p>