[Python-3000-checkins] r59357 - python/branches/py3k/Lib/test/test_io.py

christian.heimes python-3000-checkins at python.org
Wed Dec 5 18:59:44 CET 2007


Author: christian.heimes
Date: Wed Dec  5 18:59:44 2007
New Revision: 59357

Modified:
   python/branches/py3k/Lib/test/test_io.py
Log:
You are right, Guido. The newline argument is easier to use.

Modified: python/branches/py3k/Lib/test/test_io.py
==============================================================================
--- python/branches/py3k/Lib/test/test_io.py	(original)
+++ python/branches/py3k/Lib/test/test_io.py	Wed Dec  5 18:59:44 2007
@@ -525,16 +525,16 @@
         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"


More information about the Python-3000-checkins mailing list