]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 85864 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 27 Oct 2010 19:53:15 +0000 (19:53 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 27 Oct 2010 19:53:15 +0000 (19:53 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85864 | antoine.pitrou | 2010-10-27 21:45:43 +0200 (mer., 27 oct. 2010) | 5 lines

  In open(), only set the buffer size from st.st_blksize when it is greater
  than 1.  This matches the pure Python implementation in _pyio and should
  fix a couple of failures on the NetBSD buildbot.
........

Modules/_io/_iomodule.c

index ca359bc84ca7627ec3c1d9bbb037465366fcdccd..6d7121c2d9088bd407271475ed229ed54e30ef06 100644 (file)
@@ -453,7 +453,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