[pypy-commit] pypy py3k: fix the base seek impl to accept args

pjenvey noreply at buildbot.pypy.org
Fri May 10 04:16:52 CEST 2013


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r63956:55096ba173ab
Date: 2013-05-09 19:16 -0700
http://bitbucket.org/pypy/pypy/changeset/55096ba173ab/

Log:	fix the base seek impl to accept args

diff --git a/pypy/module/_io/interp_iobase.py b/pypy/module/_io/interp_iobase.py
--- a/pypy/module/_io/interp_iobase.py
+++ b/pypy/module/_io/interp_iobase.py
@@ -130,7 +130,7 @@
                 space.w_ValueError,
                 space.wrap("I/O operation on closed file"))
 
-    def seek_w(self, space):
+    def seek_w(self, space, w_offset, w_whence=None):
         self._unsupportedoperation(space, "seek")
 
     def tell_w(self, space):
diff --git a/pypy/module/_io/test/test_io.py b/pypy/module/_io/test/test_io.py
--- a/pypy/module/_io/test/test_io.py
+++ b/pypy/module/_io/test/test_io.py
@@ -45,6 +45,13 @@
         import _io
         e = _io.UnsupportedOperation("seek")
 
+    def test_default_implementations(self):
+        import _io
+        file = _io._IOBase()
+        raises(_io.UnsupportedOperation, file.seek, 0, 1)
+        raises(_io.UnsupportedOperation, file.fileno)
+        raises(_io.UnsupportedOperation, file.truncate)
+
     def test_blockingerror(self):
         import _io
         try:


More information about the pypy-commit mailing list