Please sign in to comment.
Close opened file
While file.__del__ closes itself in CPython, PyPy doesn't use reference counting but garbage collection, so destructors aren't automatically closed immediately. Invoked time of __del__ is indeterministic in PyPy. Theoretically it must never cause any problem, but in real world we can't assume setup.py script is immediately terminated. Because in many cases users install boto using setuptools/easy_install. It might cause "too many open files" error. In Windows opened files aren't accessible by other process. So we should explicitly call file.close() in try-finally block or use with block. This patch uses the latter way.
- Loading branch information...