Issue #8746: Use tempfile module to get tempdir and randomize the

link file name.
This commit is contained in:
Ned Deily 2011-07-26 13:52:14 -07:00
parent 528c4adc0b
commit d88131afd9
1 changed files with 3 additions and 1 deletions

View File

@ -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)