[Python-Dev] tempfile.TemporaryFile on Windows NT

"Martin v. Löwis" martin at v.loewis.de
Wed Sep 15 07:53:13 CEST 2004


The tempfile module has a wrapper class to implement
delete on close. On NT+, this is not necessary, since
the system supports the O_TEMPORARY flag. However
the wrapper is still created 'so that file.name is useful
(i.e. not "(fdopen)"'. I find this a weak argument, since
file.name is also "fdopen" on POSIX.

So I would like to drop the wrapper object on Windows NT,
and have tempfile.TemporaryFile return a proper file
object. Any objections?

If there are objections, would they change if file.name
would point uniformly to the file name of the temporary
file?

If so, should this be better achieved by os.fdopen grow
a name argument, or by using builtin open() in the first
place? On Windows, one can pass the additional "D" flag
to open() to get a delete-on-close file.

Regards,
Martin


More information about the Python-Dev mailing list