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

dieter dieter at handshake.de
Thu Sep 8 02:22:01 EDT 2016


"Alexander N. Moibenko" <moibenko at fnal.gov> writes:
> when I build a binary with python 2.6 it builds without any problem.
> When I build with python 2.7 the build fails after warnings like:
> /opt/python/Python-2.7.12/Modules/posixmodule.o: In function
> `posix_tempnam':
> /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?

I doubt that the (compiler) warning is responsible for the (linker) failure.

When I am faced with problems like this (usually during extension building;
I have never encountered a problem during a Python built), I try
to find out what (OS level) commands are executed by the build machinery
and then issue them manually on the command line: the build machinery
often hides error details revealed by executing the commands
directly on the command line.


What I can imagine is that your (OS level installed) C libraries (i.e. "libc"
and friends) no longer contain a "tempnam", letting the linker fail.
Thus, maybe, the compiler still warns about "tempnam" but the linker
already considers it as an error.




More information about the Python-list mailing list