[issue5178] Add content manager for temporary directory

2009-02-07 Thread Nick Coghlan
Changes by Nick Coghlan : -- priority: -> normal versions: +Python 2.7, Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue5178] Add content manager for temporary directory

2009-02-07 Thread Nick Coghlan
Nick Coghlan added the comment: 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 misleadi

[issue5178] Add content manager for temporary directory

2009-02-07 Thread Neil Schemenauer
New submission from Neil Schemenauer : I noticed that it would be nice to have a temporary directory context manager while trying to fix a broken unittest. The attached patch provides a pretty minimal implementation. There appears to be lots of unit tests that could use such a thing (just searc