diff options
author | Guido van Rossum <guido@python.org> | 2007-08-27 18:31:48 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-08-27 18:31:48 (GMT) |
commit | 9c62772d5e0e096458c6f5c8e50cc84fcc1383f7 (patch) | |
tree | 088d8c2701cf01ed6e516d83aff3182de9cb555d /Lib/test/test_zipfile.py | |
parent | 35d9428046e74cd9c36fb4507ca048dad32097cc (diff) | |
download | cpython-9c62772d5e0e096458c6f5c8e50cc84fcc1383f7.zip cpython-9c62772d5e0e096458c6f5c8e50cc84fcc1383f7.tar.gz cpython-9c62772d5e0e096458c6f5c8e50cc84fcc1383f7.tar.bz2 |
Changes in anticipation of stricter str vs. bytes enforcement.
Diffstat (limited to 'Lib/test/test_zipfile.py')
-rw-r--r-- | Lib/test/test_zipfile.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index cbbe81a..db2b34b 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -17,7 +17,7 @@ FIXEDTEST_SIZE = 1000 class TestsWithSourceFile(unittest.TestCase): def setUp(self): self.line_gen = (bytes("Zipfile test line %d. random float: %f" % - (i, random())) + (i, random()), "ascii") for i in range(FIXEDTEST_SIZE)) self.data = b'\n'.join(self.line_gen) + b'\n' @@ -246,7 +246,7 @@ class TestsWithSourceFile(unittest.TestCase): # Test appending to an existing file that is not a zipfile # NOTE: this test fails if len(d) < 22 because of the first # line "fpin.seek(-22, 2)" in _EndRecData - d = 'I am not a ZipFile!'*10 + d = b'I am not a ZipFile!'*10 f = open(TESTFN2, 'wb') f.write(d) f.close() @@ -301,7 +301,7 @@ class TestZip64InSmallFiles(unittest.TestCase): self._limit = zipfile.ZIP64_LIMIT zipfile.ZIP64_LIMIT = 5 - line_gen = (bytes("Test of zipfile line %d." % i) + line_gen = (bytes("Test of zipfile line %d." % i, "ascii") for i in range(0, FIXEDTEST_SIZE)) self.data = b'\n'.join(line_gen) @@ -806,7 +806,7 @@ class TestsWithMultipleOpens(unittest.TestCase): class UniversalNewlineTests(unittest.TestCase): def setUp(self): - self.line_gen = [bytes("Test of zipfile line %d." % i) + self.line_gen = [bytes("Test of zipfile line %d." % i, "ascii") for i in range(FIXEDTEST_SIZE)] self.seps = ('\r', '\r\n', '\n') self.arcdata, self.arcfiles = {}, {} |