This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.araujo
Recipients belopolsky, docs@python, eric.araujo, ezio.melotti, terry.reedy
Date 2010-11-20.12:36:40
SpamBayes Score 3.2104068e-05
Marked as misclassified No
Message-id <1290256603.32.0.324043679299.issue10461@psf.upfronthosting.co.za>
In-reply-to
Content
with also replaces open-try-do stuff-finally-close, the correct idiom for ensuring file handles are always closes in all VMs.

I don’t think the doc style guide is the right place, since this is a code issue.  with is advertised in http://docs.python.org/dev/tutorial/inputoutput#methods-of-file-objects and http://docs.python.org/dev/howto/doanddont#exceptions ; http://docs.python.org/dev/library/functions#open says nothing about closing, and http://docs.python.org/dev/library/io tells about the with statement without recommending it strongly.
History
Date User Action Args
2010-11-20 12:36:43eric.araujosetrecipients: + eric.araujo, terry.reedy, belopolsky, ezio.melotti, docs@python
2010-11-20 12:36:43eric.araujosetmessageid: <1290256603.32.0.324043679299.issue10461@psf.upfronthosting.co.za>
2010-11-20 12:36:40eric.araujolinkissue10461 messages
2010-11-20 12:36:40eric.araujocreate