Author: Armin Rigo <[email protected]>
Branch:
Changeset: r58629:4fe5af46568b
Date: 2012-10-30 12:42 +0100
http://bitbucket.org/pypy/pypy/changeset/4fe5af46568b/
Log: For now, disable buffering on the FILE object, to avoid issues.
diff --git a/pypy/module/_cffi_backend/ctypeptr.py
b/pypy/module/_cffi_backend/ctypeptr.py
--- a/pypy/module/_cffi_backend/ctypeptr.py
+++ b/pypy/module/_cffi_backend/ctypeptr.py
@@ -323,6 +323,7 @@
rffi_fdopen = rffi.llexternal("fdopen", [rffi.INT, rffi.CCHARP], rffi.CCHARP)
+rffi_setbuf = rffi.llexternal("setbuf", [rffi.CCHARP,rffi.CCHARP], lltype.Void)
rffi_fclose = rffi.llexternal("fclose", [rffi.CCHARP], rffi.INT)
class CffiFileObj(object):
@@ -331,6 +332,7 @@
self.llf = rffi_fdopen(fd, mode)
if not self.llf:
raise OSError(rposix.get_errno(), "fdopen failed")
+ rffi_setbuf(self.llf, lltype.nullptr(rffi.CCHARP.TO))
def close(self):
rffi_fclose(self.llf)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit