(original) (raw)

changeset: 71507:ca236138f0ce branch: 2.7 parent: 71498:e75715f27ce7 user: Ned Deily nad@acm.org date: Tue Jul 26 13:52:14 2011 -0700 files: Lib/test/test_posix.py description: Issue #8746: Use tempfile module to get tempdir and randomize the link file name. diff -r e75715f27ce7 -r ca236138f0ce Lib/test/test_posix.py --- a/Lib/test/test_posix.py Mon Jul 25 07:23:58 2011 +0200 +++ b/Lib/test/test_posix.py Tue Jul 26 13:52:14 2011 -0700 @@ -13,10 +13,12 @@ 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) /nad@acm.org