Commits

Christian Heimes committed dad9ed3

You are right, Guido. The newline argument is easier to use.

Comments (0)

Files changed (1)

         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"