From 6d8898b5eb741645d5d7352b0f49bde190355eaa Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 25 Mar 2002 15:32:01 +0000 Subject: [PATCH] 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. --- Modules/socketmodule.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index ef5967ab80d..4f35b32bc0a 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -1365,6 +1365,11 @@ PySocketSock_makefile(PySocketSockObject *s, PyObject *args) SOCKETCLOSE(fd); return s->errorhandler(); } +#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);