warner/python-versioneer — pull request #7 by bfroehle (2013-01-23 23:39:56+00:00)
Title: Silence py3 warnings about files left open.

This isn't an exhaustive list, nor is it necessarily safe against
exceptions, but it does suffice for me in "normal operations."

Adding exception safe versions would be quite tiresome, as Python 2.4
does not have a try-except-finally block (only try-except and try-finally).
The code, if were to go down that road, would be:

f = open(...)
try:
try:
# use f here
except:
# handle exceptions
finally:
f.close()