diff options
author | Christian Heimes <christian@cheimes.de> | 2007-12-05 17:59:44 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-12-05 17:59:44 (GMT) |
commit | ecda261f59c4434fdc8a5b3eb329fbfb3d32ec9e (patch) | |
tree | 97bdc95f0ee1bec3223d8cc2287f5e96eafafbe7 | |
parent | 2ca76f693c1b14634d8cb3fd8821654bf9166dae (diff) | |
download | cpython-ecda261f59c4434fdc8a5b3eb329fbfb3d32ec9e.zip cpython-ecda261f59c4434fdc8a5b3eb329fbfb3d32ec9e.tar.gz cpython-ecda261f59c4434fdc8a5b3eb329fbfb3d32ec9e.tar.bz2 |
You are right, Guido. The newline argument is easier to use.
-rw-r--r-- | Lib/test/test_io.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 2f222af..f5b4a94 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -525,16 +525,16 @@ class TextIOWrapperTest(unittest.TestCase): self.assertRaises(UnicodeError, t.write, "\xff") # (3) ignore b = io.BytesIO() - t = io.TextIOWrapper(b, encoding="ascii", errors="ignore") + t = io.TextIOWrapper(b, encoding="ascii", errors="ignore", newline="\n") t.write("abc\xffdef\n") t.flush() - self.assertEquals(b.getvalue(), b"abcdef" + os.linesep.encode()) + self.assertEquals(b.getvalue(), b"abcdef\n") # (4) replace b = io.BytesIO() - t = io.TextIOWrapper(b, encoding="ascii", errors="replace") + t = io.TextIOWrapper(b, encoding="ascii", errors="replace", newline="\n") t.write("abc\xffdef\n") t.flush() - self.assertEquals(b.getvalue(), b"abc?def" + os.linesep.encode()) + self.assertEquals(b.getvalue(), b"abc?def\n") def testNewlinesInput(self): testdata = b"AAA\nBBB\nCCC\rDDD\rEEE\r\nFFF\r\nGGG" |