how to switch from os.tmpnam to os.tmpfile

Harold Fellermann dadapapa at googlemail.com
Thu Jun 8 09:30:39 EDT 2006


Hi,

I need to create a temporary file and I need to retrieve the path of
that file.
os.tmpnam() would do the job quite well if it wasn't for the
RuntimeWarning
"tmpnam is a potential security risk to your program". I would like to
switch
to os.tmpfile() which is supposed to be safer, but I do not know how to
get
the path information from the file object returned by tmpfile(). any
clues?
thanks!

- harold -




More information about the Python-list mailing list