]> granicus.if.org Git - python/commitdiff
Due to interaction between the MSL C library and the GUSI I/O library I can get reads...
authorJack Jansen <jack.jansen@cwi.nl>
Mon, 25 Mar 2002 15:32:01 +0000 (15:32 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Mon, 25 Mar 2002 15:32:01 +0000 (15:32 +0000)
The workaround is to force socket.makefile() to disable buffering for binary files.

Fixes bug 534625. 2.2.1 candidate.

Modules/socketmodule.c

index ef5967ab80d042d830c3c27d24d4b9ee2479a302..4f35b32bc0a45bc907785ac2d8d9e37156ddd32d 100644 (file)
@@ -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, "<socket>", mode, fclose);
        if (f != NULL)
                PyFile_SetBufSize(f, bufsize);