]> granicus.if.org Git - python/commitdiff
Fixed line separator problem on Windows
authorChristian Heimes <christian@cheimes.de>
Wed, 5 Dec 2007 13:24:28 +0000 (13:24 +0000)
committerChristian Heimes <christian@cheimes.de>
Wed, 5 Dec 2007 13:24:28 +0000 (13:24 +0000)
Lib/test/test_io.py

index 36aaf14fc8cb1faddfea75ad68a07758aab279aa..2f222aff3baf62f730b37998fd81cac8bee9967f 100644 (file)
@@ -528,13 +528,13 @@ class TextIOWrapperTest(unittest.TestCase):
         t = io.TextIOWrapper(b, encoding="ascii", errors="ignore")
         t.write("abc\xffdef\n")
         t.flush()
-        self.assertEquals(b.getvalue(), b"abcdef\n")
+        self.assertEquals(b.getvalue(), b"abcdef" + os.linesep.encode())
         # (4) replace
         b = io.BytesIO()
         t = io.TextIOWrapper(b, encoding="ascii", errors="replace")
         t.write("abc\xffdef\n")
         t.flush()
-        self.assertEquals(b.getvalue(), b"abc?def\n")
+        self.assertEquals(b.getvalue(), b"abc?def" + os.linesep.encode())
 
     def testNewlinesInput(self):
         testdata = b"AAA\nBBB\nCCC\rDDD\rEEE\r\nFFF\r\nGGG"