[issue22831] Use "with" to avoid possible fd leaks

Martin Panter report at bugs.python.org
Fri Mar 20 13:36:25 CET 2015


Martin Panter added the comment:

There were a couple mistakes I found; see Reitveld. I was going to say to leave the open(mode="r") parameter as it is, since an explicit "r" is more readable, but since you already took some out, I’m not going to complain.

While many of the changes look worthwhile, I do worry that some of them will never be tested (at least until say Python 3.14 or something). E.g. I just tried running Tools/scripts/dutree.py cos it looked interesting, but was confronted with the “unorderable types: int() < NoneType()” Python 2-ism.

----------

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


More information about the Python-bugs-list mailing list