[pypy-svn] pypy default: Only use st_blksize when its > 1. Port this logic over from _pyio, and the CPython 2.7 maintanance branch.

alex_gaynor commits-noreply at bitbucket.org
Mon Jan 31 01:35:29 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r41480:7a9ba1d57b77
Date: 2011-01-30 19:35 -0500
http://bitbucket.org/pypy/pypy/changeset/7a9ba1d57b77/

Log:	Only use st_blksize when its > 1. Port this logic over from _pyio,
	and the CPython 2.7 maintanance branch.

diff --git a/pypy/module/_io/interp_io.py b/pypy/module/_io/interp_io.py
--- a/pypy/module/_io/interp_io.py
+++ b/pypy/module/_io/interp_io.py
@@ -126,7 +126,8 @@
                 # Errors should never pass silently, except this one time.
                 pass
             else:
-                buffering = st.st_blksize
+                if st.st_blksize > 1:
+                    buffering = st.st_blksize
 
     if buffering < 0:
         raise OperationError(space.w_ValueError,


More information about the Pypy-commit mailing list