[pypy-commit] pypy use-file-star-for-file: try to fix test_write_full

bdkearns noreply at buildbot.pypy.org
Thu Sep 11 07:15:19 CEST 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: use-file-star-for-file
Changeset: r73445:a337ec6aba73
Date: 2014-09-11 01:14 -0400
http://bitbucket.org/pypy/pypy/changeset/a337ec6aba73/

Log:	try to fix test_write_full

diff --git a/rpython/rlib/rfile.py b/rpython/rlib/rfile.py
--- a/rpython/rlib/rfile.py
+++ b/rpython/rlib/rfile.py
@@ -468,9 +468,9 @@
         try:
             # note that since we got a nonmoving buffer, it is either raw
             # or already cannot move, so the arithmetics below are fine
-            length = len(value)
-            bytes = c_fwrite(ll_value, 1, length, self._ll_file)
-            if bytes != length:
+            n = len(value)
+            n2 = c_fwrite(ll_value, 1, n, self._ll_file)
+            if n2 != n or c_ferror(self._ll_file):
                 errno = rposix.get_errno()
                 c_clearerr(self._ll_file)
                 raise IOError(errno, os.strerror(errno))


More information about the pypy-commit mailing list