]> granicus.if.org Git - python/commitdiff
Issue #8746: Use tempfile module to get tempdir and randomize the
authorNed Deily <nad@acm.org>
Tue, 26 Jul 2011 20:52:14 +0000 (13:52 -0700)
committerNed Deily <nad@acm.org>
Tue, 26 Jul 2011 20:52:14 +0000 (13:52 -0700)
link file name.

Lib/test/test_posix.py

index 3b9bc205a0660dcd5dfbf8427ef1e55ef21df817..a6a73063ce378e4c7c4bedd83809c496db591e82 100644 (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)