[pypy-commit] pypy default: test/fix rfile seek case with univ newline

bdkearns noreply at buildbot.pypy.org
Tue Sep 9 17:38:53 CEST 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r73393:c4e64d36778a
Date: 2014-09-09 11:34 -0400
http://bitbucket.org/pypy/pypy/changeset/c4e64d36778a/

Log:	test/fix rfile seek case with univ newline

diff --git a/rpython/rlib/rfile.py b/rpython/rlib/rfile.py
--- a/rpython/rlib/rfile.py
+++ b/rpython/rlib/rfile.py
@@ -460,6 +460,7 @@
         if res == -1:
             errno = rposix.get_errno()
             raise IOError(errno, os.strerror(errno))
+        self._skipnextlf = False
 
     def tell(self):
         self._check_closed()
diff --git a/rpython/rlib/test/test_rfile.py b/rpython/rlib/test/test_rfile.py
--- a/rpython/rlib/test/test_rfile.py
+++ b/rpython/rlib/test/test_rfile.py
@@ -212,6 +212,11 @@
             assert f.readline() == "dupd"
             assert f.tell() == 20
             assert f.readline() == ""
+            f.seek(0)
+            assert f.readline() == "dupa\n"
+            assert f.readline() == "dupb\n"
+            f.seek(4)
+            assert f.read(1) == "\n"
             f.close()
 
         f()


More information about the pypy-commit mailing list