[issue18644] Got ResourceWarning: unclosed file when using test function from formatter module

STINNER Victor report at bugs.python.org
Mon Jan 5 10:57:35 CET 2015


STINNER Victor added the comment:

> fl = contextlib.closing(open(sys.argv[1]))

I prefer the current code with the explicit close() and "is not sys.stdin", it's less magic :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18644>
_______________________________________


More information about the Python-bugs-list mailing list