diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index c0c81546542..44bdac6b5cf 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