[issue14243] NamedTemporaryFile usability request

Dave Abrahams report at bugs.python.org
Sat Mar 10 03:14:08 CET 2012


New submission from Dave Abrahams <dave at boostpro.com>:

NamedTemporaryFile is too hard to use portably when you need to open the file by name after writing it.  To do that, you need to close the file first (on Windows), which means you have to pass delete=False, which in turn means that you get no help in cleaning up the actual file resource, which as you can see from the code in tempfile.py is devilishly hard to do correctly.  The fact that it's different on posix (you can open the file for reading by name without closing it first) makes this problem worse. What we really need for this use-case is a way to say, "delete on __del__ but not on close()."

----------
components: Library (Lib)
messages: 155278
nosy: dabrahams
priority: normal
severity: normal
status: open
title: NamedTemporaryFile usability request
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14243>
_______________________________________


More information about the Python-bugs-list mailing list