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 r.david.murray
Recipients georg.brandl, r.david.murray, vincele
Date 2009-09-12.02:46:52
SpamBayes Score 2.0960561e-10
Marked as misclassified No
Message-id <1252723614.44.0.401597502969.issue6875@psf.upfronthosting.co.za>
In-reply-to
Content
I don't think it would be beneficial to just talk about closing the file
descriptor, or to talk about os open file limits.  Closing open files
when they are no longer needed is just good programming practice and IMO
a discussion of it doesn't belong in the library docs unless it is at a
more generic level (like os.open or open).

I don't think the code shown in your blog post is using the library the
way it is designed.  If the programmer wants an open file object, they
should use TemporaryFile or NamedTemporaryFile.  If there really is a
reason to get an os file handle and turn it into a file object, then
os.openfd should be used.  Perhaps the appropriate change to the
documentation would be to mention os.openfd, and to mention that
os.close is the correct function to use to close the file handle when it
is no longer needed (unless, of course, openfd has been called).

As for your markup, your ``os.close`` should instead be
:func:`os.close`, which results in the automatic creation of a link to
the os.close documentation.
History
Date User Action Args
2009-09-12 02:46:54r.david.murraysetrecipients: + r.david.murray, georg.brandl, vincele
2009-09-12 02:46:54r.david.murraysetmessageid: <1252723614.44.0.401597502969.issue6875@psf.upfronthosting.co.za>
2009-09-12 02:46:53r.david.murraylinkissue6875 messages
2009-09-12 02:46:52r.david.murraycreate