Author martin.panter
Recipients Arfrever, berker.peksag, ezio.melotti, martin.panter, python-dev, rhettinger, serhiy.storchaka, vstinner
Date 2016-01-06.05:43:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1452059013.44.0.36419650146.issue22831@psf.upfronthosting.co.za>
In-reply-to
Content
I had another look at the five patches you mentioned. I made a couple review comments about expanding the scope of some “with” statements.

There are a couple changes that add explicit file closing, where it was previously up to the garbage collector. I.e. code like open(...).read(). I think those changes are the most important, although they are scattered over the various patches.

On the other hand, some of the changes in the test suite, particularly test_dbm_dumb.py and test_xmlrpc.py, hardly seem worth it. The main benefit of the “with” statement would be if the test code fails, which hopefully won’t happen that often. :)

In the test suite, perhaps it would be better to call self.addCleanup(f.close) or similar in many cases. That way you wouldn’t need contextlib.closing() as much, and there would be less file history clutter and “cavern code”, due to the extra indentation.
History
Date User Action Args
2016-01-06 05:43:33martin.pantersetrecipients: + martin.panter, rhettinger, vstinner, ezio.melotti, Arfrever, python-dev, berker.peksag, serhiy.storchaka
2016-01-06 05:43:33martin.pantersetmessageid: <1452059013.44.0.36419650146.issue22831@psf.upfronthosting.co.za>
2016-01-06 05:43:33martin.panterlinkissue22831 messages
2016-01-06 05:43:32martin.pantercreate