diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index 733a7b95d72..a1c451eb566 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -451,7 +451,7 @@ io_open(PyObject *self, PyObject *args, PyObject *kwds) if (fileno == -1 && PyErr_Occurred()) goto error; - if (fstat(fileno, &st) >= 0) + if (fstat(fileno, &st) >= 0 && st.st_blksize > 1) buffering = st.st_blksize; } #endif