diff options
author | Nadeem Vawda <nadeem.vawda@gmail.com> | 2012-05-06 14:25:35 (GMT) |
---|---|---|
committer | Nadeem Vawda <nadeem.vawda@gmail.com> | 2012-05-06 14:25:35 (GMT) |
commit | 9d9dc8eba031d74bad4abcfd2b4244132adadd10 (patch) | |
tree | a8fa52f6d9cd79606984d1bb179f8b03dbbb8a45 /Lib/test | |
parent | b55d9e3e195a24edd7f7bae1430d27b6650d4e3d (diff) | |
download | cpython-9d9dc8eba031d74bad4abcfd2b4244132adadd10.zip cpython-9d9dc8eba031d74bad4abcfd2b4244132adadd10.tar.gz cpython-9d9dc8eba031d74bad4abcfd2b4244132adadd10.tar.bz2 |
Fix test_gzip failures on Windows.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_gzip.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index ae9fb1b..d7b5d49 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -409,7 +409,7 @@ class TestOpen(BaseTest): self.assertEqual(file_data, uncompressed * 2) def test_text_modes(self): - uncompressed = data1.decode("ascii") * 50 + uncompressed = data1.decode("ascii").replace("\n", os.linesep) * 50 with gzip.open(self.filename, "wt") as f: f.write(uncompressed) with open(self.filename, "rb") as f: @@ -436,7 +436,7 @@ class TestOpen(BaseTest): def test_encoding(self): # Test non-default encoding. - uncompressed = data1.decode("ascii") * 50 + uncompressed = data1.decode("ascii").replace("\n", os.linesep) * 50 with gzip.open(self.filename, "wt", encoding="utf-16") as f: f.write(uncompressed) with open(self.filename, "rb") as f: @@ -456,7 +456,7 @@ class TestOpen(BaseTest): def test_newline(self): # Test with explicit newline (universal newline mode disabled). uncompressed = data1.decode("ascii") * 50 - with gzip.open(self.filename, "wt") as f: + with gzip.open(self.filename, "wt", newline="\n") as f: f.write(uncompressed) with gzip.open(self.filename, "rt", newline="\r") as f: self.assertEqual(f.readlines(), [uncompressed]) |