[Python-Dev] Warn about mktemp once again? (original) (raw)

skip at pobox.com skip at pobox.com
Tue Apr 29 01:35:28 CEST 2008


Guido> IMO mkstemp() is a major pain because you have to use raw file
Guido> descriptors on the return value. I'd much rather recommend
Guido> [Named]TemporaryFile which return streams.

Why not:

fd, fname = tempfile.mkstemp()
f = os.fdopen(fd)

Seems fairly straightforward to me.

Skip



More information about the Python-Dev mailing list