]> granicus.if.org Git - python/commitdiff
Issue #9858: Add missing method stubs to _io.RawIOBase. Patch by Laura Rupprecht.
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 20 May 2015 19:50:59 +0000 (21:50 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 20 May 2015 19:50:59 +0000 (21:50 +0200)
Lib/test/test_io.py
Misc/ACKS
Misc/NEWS
Modules/_io/iobase.c

index f7c6e2ddb00770dc068819bed2297a1ffd8d77d1..af7da0193d5c72130337df030d185bfcdb7ab6f5 100644 (file)
@@ -722,10 +722,10 @@ class PyIOTest(IOTest):
 @support.cpython_only
 class APIMismatchTest(unittest.TestCase):
 
-    @unittest.expectedFailure  # Test to be fixed by issue9858.
     def test_RawIOBase_io_in_pyio_match(self):
         """Test that pyio RawIOBase class has all c RawIOBase methods"""
-        mismatch = support.detect_api_mismatch(pyio.RawIOBase, io.RawIOBase)
+        mismatch = support.detect_api_mismatch(pyio.RawIOBase, io.RawIOBase,
+                                               ignore=('__weakref__',))
         self.assertEqual(mismatch, set(), msg='Python RawIOBase does not have all C RawIOBase methods')
 
     def test_RawIOBase_pyio_in_io_match(self):
index 71fb0c54b4c191739649ab778f8b4e70c5ccf5dd..807eeb27a6a180dea22d7d6c89a3676f886c8ed1 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1212,6 +1212,7 @@ Demur Rumed
 Audun S. Runde
 Eran Rundstein
 Rauli Ruohonen
+Laura Rupprecht
 Jeff Rush
 Sam Rushing
 Mark Russell
index ab12a6562a2887d1d9e83f3547263b9db55f8728..fe83306ec1df27bc22377e3867a7f5d360534cc9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -52,6 +52,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #9858: Add missing method stubs to _io.RawIOBase.  Patch by Laura
+  Rupprecht.
+
 - Issue #22955: attrgetter, itemgetter and methodcaller objects in the operator
   module now support pickling.  Added readable and evaluable repr for these
   objects.  Based on patch by Josh Rosenberg.
index 79d716a98ab64082107c446011795fb739edb401..025007e40dc2b5fba3b8f5030f8947e2d275cb6a 100644 (file)
@@ -952,9 +952,25 @@ _io__RawIOBase_readall_impl(PyObject *self)
     return result;
 }
 
+static PyObject *
+rawiobase_readinto(PyObject *self, PyObject *args)
+{
+    PyErr_SetNone(PyExc_NotImplementedError);
+    return NULL;
+}
+
+static PyObject *
+rawiobase_write(PyObject *self, PyObject *args)
+{
+    PyErr_SetNone(PyExc_NotImplementedError);
+    return NULL;
+}
+
 static PyMethodDef rawiobase_methods[] = {
     _IO__RAWIOBASE_READ_METHODDEF
     _IO__RAWIOBASE_READALL_METHODDEF
+    {"readinto", rawiobase_readinto, METH_VARARGS},
+    {"write", rawiobase_write, METH_VARARGS},
     {NULL, NULL}
 };