[Python-checkins] cpython (2.7): Issue #8746: Use tempfile module to get tempdir and randomize the

ned.deily python-checkins at python.org
Tue Jul 26 23:00:13 CEST 2011


http://hg.python.org/cpython/rev/ca236138f0ce
changeset:   71507:ca236138f0ce
branch:      2.7
parent:      71498:e75715f27ce7
user:        Ned Deily <nad at acm.org>
date:        Tue Jul 26 13:52:14 2011 -0700
summary:
  Issue #8746: Use tempfile module to get tempdir and randomize the
link file name.

files:
  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
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list