cpython: ca236138f0ce (original) (raw)
Mercurial > cpython
changeset 71507:ca236138f0ce 2.7
Issue #8746: Use tempfile module to get tempdir and randomize the link file name. [#8746]
Ned Deily nad@acm.org | |
---|---|
date | Tue, 26 Jul 2011 13:52:14 -0700 |
parents | e75715f27ce7 |
children | 73ae3729b8fe |
files | Lib/test/test_posix.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-)[+] [-] Lib/test/test_posix.py 4 |
line wrap: on
line diff
--- 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')[](#l1.13)
warnings.filterwarnings('ignore', '.* potential security risk .*', RuntimeWarning)