summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-12-05 17:59:44 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-12-05 17:59:44 (GMT)
commitecda261f59c4434fdc8a5b3eb329fbfb3d32ec9e (patch)
tree97bdc95f0ee1bec3223d8cc2287f5e96eafafbe7 /Lib/test
parent2ca76f693c1b14634d8cb3fd8821654bf9166dae (diff)
downloadcpython-ecda261f59c4434fdc8a5b3eb329fbfb3d32ec9e.zip
cpython-ecda261f59c4434fdc8a5b3eb329fbfb3d32ec9e.tar.gz
cpython-ecda261f59c4434fdc8a5b3eb329fbfb3d32ec9e.tar.bz2
You are right, Guido. The newline argument is easier to use.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_io.py8
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"