From: Ned Deily Date: Tue, 26 Jul 2011 20:52:14 +0000 (-0700) Subject: Issue #8746: Use tempfile module to get tempdir and randomize the X-Git-Tag: v2.7.3rc1~575 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d88131afd9a683b16c4c80e1ff8e58f123cbd888;p=thirdparty%2FPython%2Fcpython.git Issue #8746: Use tempfile module to get tempdir and randomize the link file name. --- diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 3b9bc205a066..a6a73063ce37 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -13,10 +13,12 @@ import pwd import shutil import stat import sys +import tempfile import unittest import warnings -_DUMMY_SYMLINK = '%s/dummy-symlink' % os.getenv('TMPDIR', '/tmp') +_DUMMY_SYMLINK = os.path.join(tempfile.gettempdir(), + test_support.TESTFN + '-dummy-symlink') warnings.filterwarnings('ignore', '.* potential security risk .*', RuntimeWarning)