[New-bugs-announce] [issue6965] tmpnam should not be used if tempfile or mkstemp are available

djc report at bugs.python.org
Tue Sep 22 11:21:58 CEST 2009


New submission from djc <dirkjan at ochtman.nl>:

I have a bug report in the Gentoo tracker
(http://bugs.gentoo.org/show_bug.cgi?id=221183):

"This is a rather strange request, but please bear me.
While building Posix module, python checks (among others) for
tmpfile, tmpnam and tmpnam_r
however man pages state explicitly, that in case tmpfile is available, other
two should not be used
if libpython2.5.a is built with either of them, linker complains each
time it's
added

While this doesn't break anything, it's still a bit annoying.
so I propose to remove functionality as an enhancement:
to change in Modules/posixmodule.c
#ifdef HAVE_TMPNAM
to
#ifdef HAVE_TMPNAM && !defined(HAVE_TMPFILE)

Your thoughts?"

man 3 tmpnam state "Never use this function.  Use mkstemp(3) or
tmpfile(3) instead.".

Not sure whether this is exposed anywhere, but I figured this bug would
be better handled upstream from Gentoo.

----------
components: Extension Modules
messages: 92975
nosy: djc
severity: normal
status: open
title: tmpnam should not be used if tempfile or mkstemp are available
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6965>
_______________________________________


More information about the New-bugs-announce mailing list