summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tarfile.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-03-07 12:50:45 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-03-07 12:50:45 (GMT)
commitc7fcc2d772c6ccaa71002aaa2aace16ed8adf471 (patch)
treeaf159efb6428d8de8bcb0a5ebe92fc363929651a /Lib/test/test_tarfile.py
parent834eff6a4ca700cb39a820db03e8c185c1b5dcb5 (diff)
downloadcpython-c7fcc2d772c6ccaa71002aaa2aace16ed8adf471.zip
cpython-c7fcc2d772c6ccaa71002aaa2aace16ed8adf471.tar.gz
cpython-c7fcc2d772c6ccaa71002aaa2aace16ed8adf471.tar.bz2
Two fixes to make this test pass on MacOS9:
- the test was sloppy about filenames: "0-REGTYPE-TEXT" was used where the archive held "/0-REGTYPE-TEXT". - tarfile extracts all files in binary mode, but the test expected to be able to read and compare text files in text mode. Use universal text mode.
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r--Lib/test/test_tarfile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index 4a8edb8..f865ceb 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -74,7 +74,7 @@ class ReadTest(BaseTest):
"""
if self.sep != "|":
f1 = self.tar.extractfile("S-SPARSE")
- f2 = self.tar.extractfile("S-SPARSE-WITH-NULLS")
+ f2 = self.tar.extractfile("/S-SPARSE-WITH-NULLS")
self.assert_(f1.read() == f2.read(),
"_FileObject failed on sparse file member")
@@ -82,9 +82,9 @@ class ReadTest(BaseTest):
"""Test readlines() method of _FileObject.
"""
if self.sep != "|":
- filename = "0-REGTYPE-TEXT"
+ filename = "/0-REGTYPE-TEXT"
self.tar.extract(filename, dirname())
- lines1 = file(os.path.join(dirname(), filename), "r").readlines()
+ lines1 = file(os.path.join(dirname(), filename), "rU").readlines()
lines2 = self.tar.extractfile(filename).readlines()
self.assert_(lines1 == lines2,
"_FileObject.readline() does not work correctly")
@@ -93,7 +93,7 @@ class ReadTest(BaseTest):
"""Test seek() method of _FileObject, incl. random reading.
"""
if self.sep != "|":
- filename = "0-REGTYPE"
+ filename = "/0-REGTYPE"
self.tar.extract(filename, dirname())
data = file(os.path.join(dirname(), filename), "rb").read()