Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 941ee88

Browse files
committed
Merged revisions 76217 via svnmerge from
svn+ssh://[email protected]/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. ........
1 parent cf4cabb commit 941ee88

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

Lib/test/test_tarfile.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,8 @@
2626
def md5sum(data):
2727
return md5(data).hexdigest()
2828

29-
def path(path):
30-
return support.findfile(path)
31-
32-
TEMPDIR = os.path.join(tempfile.gettempdir(), "test_tarfile_tmp")
33-
tarname = path("testtar.tar")
29+
TEMPDIR = os.path.abspath(support.TESTFN)
30+
tarname = support.findfile("testtar.tar")
3431
gzipname = os.path.join(TEMPDIR, "testtar.tar.gz")
3532
bz2name = os.path.join(TEMPDIR, "testtar.tar.bz2")
3633
tmpname = os.path.join(TEMPDIR, "tmp.tar")
@@ -1244,8 +1241,7 @@ def test_partial_input_bz2(self):
12441241

12451242

12461243
def test_main():
1247-
if not os.path.exists(TEMPDIR):
1248-
os.mkdir(TEMPDIR)
1244+
os.makedirs(TEMPDIR)
12491245

12501246
tests = [
12511247
UstarReadTest,

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ Documentation
373373
Tests
374374
-----
375375

376+
- Issue #7295: Do not use a hardcoded file name in test_tarfile.
377+
376378
- Issue #7270: Add some dedicated unit tests for multi-thread synchronization
377379
primitives such as Lock, RLock, Condition, Event and Semaphore.
378380

0 commit comments

Comments
 (0)