Fwd: Fwd: Python freeze fails with warning: the use of `tempnam' is dangerous, better use `mkstemp'

Ben Finney ben+python at benfinney.id.au
Wed Sep 7 18:36:12 EDT 2016


"Alexander N. Moibenko" <moibenko at fnal.gov> writes:

> /opt/python/Python-2.7.12/./Modules/posixmodule.c:7578: warning: the
> use of `tempnam' is dangerous, better use `mkstemp'
> collect2: ld returned 1 exit status
>
> How this can be fixed?

The clearest answer is already there in the warning message. Replace
your use of ‘tempnam’ with ‘mkstemp’.

If you don't know what that means because you didn't write the code,
then this is for whoever is maintaining that code. Read it, learn what
it does, find (or write) its unit tests to make sue you don't break
anything; then, change that usage as suggested.

-- 
 \        “Consider the daffodil. And while you're doing that, I'll be |
  `\              over here, looking through your stuff.” —Jack Handey |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list