From: Michael W. Hudson Date: Mon, 25 Mar 2002 17:40:43 +0000 (+0000) Subject: backport jackjansen's checkin of X-Git-Tag: v2.2.1c2~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6403be2c004c0dca2e1abcb8b31954f1efb2179c;p=thirdparty%2FPython%2Fcpython.git backport jackjansen's checkin of revision 1.211 of socketmodule.c Due to interaction between the MSL C library and the GUSI I/O library I can get reads from sockets to work consistently either for unbuffered binary files or for buffered binary files, but not for both:-( The workaround is to force socket.makefile() to disable buffering for binary files. Fixes bug 534625. 2.2.1 candidate. --- diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 25912a4e6bdb..182496c2b173 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -1453,6 +1453,11 @@ PySocketSock_makefile(PySocketSockObject *s, PyObject *args) SOCKETCLOSE(fd); return PySocket_Err(); } +#ifdef USE_GUSI2 + /* Workaround for bug in Metrowerks MSL vs. GUSI I/O library */ + if (strchr(mode, 'b') != NULL ) + bufsize = 0; +#endif f = PyFile_FromFile(fp, "", mode, fclose); if (f != NULL) PyFile_SetBufSize(f, bufsize);