Issue #9854: The default read() implementation in io.RawIOBase now
handles non-blocking readinto() returning None correctly.
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c
index c74672d..9b58137 100644
--- a/Modules/_io/iobase.c
+++ b/Modules/_io/iobase.c
@@ -777,9 +777,9 @@
return NULL;
res = PyObject_CallMethodObjArgs(self, _PyIO_str_readinto, b, NULL);
- if (res == NULL) {
+ if (res == NULL || res == Py_None) {
Py_DECREF(b);
- return NULL;
+ return res;
}
n = PyNumber_AsSsize_t(res, PyExc_ValueError);