Fixed line separator problem on Windows

This commit is contained in:
Christian Heimes 2007-12-05 13:24:28 +00:00
parent 1239ad81e0
commit 2ca76f693c
1 changed files with 2 additions and 2 deletions

View File

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