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 ncoghlan
Recipients nascheme, ncoghlan
Date 2009-02-07.21:31:09
SpamBayes Score 6.361701e-05
Marked as misclassified No
Message-id <1234042272.7.0.822737224826.issue5178@psf.upfronthosting.co.za>
In-reply-to
Content
A __del__ method is definitely desirable (tempfile._TemporaryFileWrapper
gives an example of how to cache the relevant globals on the class
object to avoid attempting calls to None during interpreter shutdown).

The new examples are good, but may give the misleading impression that
TemporaryFile can't be used as a context manager (it can, and the file
will be closed at the end of the with statement). A second file example
showing it being used as a context manager would probably be helpful.

There is also at least one existing contextlib based temp_dir context
managers that could be replaced given the addition of this (i.e. in
test_cmd_line_script.py, "test_dir" could be changed to a class that
inherits from tempfile.TemporaryDirectory and overrides __enter__ to
invoke realname() on the directory name).
History
Date User Action Args
2009-02-07 21:31:12ncoghlansetrecipients: + ncoghlan, nascheme
2009-02-07 21:31:12ncoghlansetmessageid: <1234042272.7.0.822737224826.issue5178@psf.upfronthosting.co.za>
2009-02-07 21:31:11ncoghlanlinkissue5178 messages
2009-02-07 21:31:10ncoghlancreate