thebeansgroup/smush.py — pull request #3 by rjnienaber (2012-05-12 08:30:51+00:00)
Title: Fix for 'Too Many Files' error because tempfile.mkstemp

I was getting a 'too many files' OSError when running smush.py on Ubuntu 12.04. [tempfile.mkstemp](http://docs.python.org/library/tempfile.html#tempfile.mkstemp) returns an open file handle as well as the file name. This wasn't getting closed causing the script to fallover at (I think) 1024 open temp files. Adding [os.close](http://docs.python.org/library/os.html#os.close) makes the script run without error.