Commits

Philip Jenvey committed 55096ba

fix the base seek impl to accept args

Comments (0)

Files changed (2)

pypy/module/_io/interp_iobase.py

                 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):

pypy/module/_io/test/test_io.py

         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: