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

Guido van Rossum guido at python.org
Wed Dec 5 18:22:26 CET 2007


Thanks for fixing this! (Though personally I'd have fixed this by
forcing the newline delimiter in the TextIOWrapper() call. What do you
think?)

On Dec 5, 2007 5:24 AM, christian.heimes
<python-3000-checkins at python.org> wrote:
> Author: christian.heimes
> Date: Wed Dec  5 14:24:28 2007
> New Revision: 59353
>
> Modified:
>    python/branches/py3k/Lib/test/test_io.py
> Log:
> Fixed line separator problem on Windows
>
> 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 14:24:28 2007
> @@ -528,13 +528,13 @@
>          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"
> _______________________________________________
> Python-3000-checkins mailing list
> Python-3000-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-3000-checkins
>



-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000-checkins mailing list