diff options
| author | Ned Deily <nad@acm.org> | 2011-07-26 20:52:14 (GMT) |
|---|---|---|
| committer | Ned Deily <nad@acm.org> | 2011-07-26 20:52:14 (GMT) |
| commit | d88131afd9a683b16c4c80e1ff8e58f123cbd888 (patch) | |
| tree | 26b5ec1cbc5377cd232c3132135d1998ff90f575 /Lib/test/test_posix.py | |
| parent | 528c4adc0be4ca043b11fae945a69f8b392a376b (diff) | |
| download | cpython-d88131afd9a683b16c4c80e1ff8e58f123cbd888.zip cpython-d88131afd9a683b16c4c80e1ff8e58f123cbd888.tar.gz cpython-d88131afd9a683b16c4c80e1ff8e58f123cbd888.tar.bz2 | |
Issue #8746: Use tempfile module to get tempdir and randomize the
link file name.
Diffstat (limited to 'Lib/test/test_posix.py')
| -rw-r--r-- | Lib/test/test_posix.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 3b9bc20..a6a7306 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) |
