]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 76219 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 11 Nov 2009 21:01:33 +0000 (21:01 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 11 Nov 2009 21:01:33 +0000 (21:01 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r76219 | antoine.pitrou | 2009-11-11 21:59:38 +0100 (mer., 11 nov. 2009) | 9 lines

  Merged revisions 76217 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r76217 | antoine.pitrou | 2009-11-11 21:55:07 +0100 (mer., 11 nov. 2009) | 3 lines

    Issue #7295: Do not use a hardcoded file name in test_tarfile.
  ........
................

Lib/test/test_tarfile.py
Misc/NEWS

index 76390c76f1172a5b1a732774f6a3bd19d690b2b9..d0dd71e860f5241da3207895d3bf00d0826a1443 100644 (file)
@@ -26,11 +26,8 @@ except ImportError:
 def md5sum(data):
     return md5(data).hexdigest()
 
-def path(path):
-    return support.findfile(path)
-
-TEMPDIR = os.path.join(tempfile.gettempdir(), "test_tarfile_tmp")
-tarname = path("testtar.tar")
+TEMPDIR = os.path.abspath(support.TESTFN)
+tarname = support.findfile("testtar.tar")
 gzipname = os.path.join(TEMPDIR, "testtar.tar.gz")
 bz2name = os.path.join(TEMPDIR, "testtar.tar.bz2")
 tmpname = os.path.join(TEMPDIR, "tmp.tar")
@@ -1146,8 +1143,7 @@ class Bz2PartialReadTest(unittest.TestCase):
 
 
 def test_main():
-    if not os.path.exists(TEMPDIR):
-        os.mkdir(TEMPDIR)
+    os.makedirs(TEMPDIR)
 
     tests = [
         UstarReadTest,
index 5a90269c7c00f7735279db967ef6c617b43df65e..e4791cff803b4cc24ae38b7209625c88c92fa6cf 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -144,6 +144,8 @@ Extension Modules
 Tests
 -----
 
+- Issue #7295: Do not use a hardcoded file name in test_tarfile.
+
 - Issue #7270: Add some dedicated unit tests for multi-thread synchronization
   primitives such as Lock, RLock, Condition, Event and Semaphore.