mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
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.
This commit is contained in:
parent
03ffbcd393
commit
6d8898b5eb
1 changed files with 5 additions and 0 deletions
|
@ -1365,6 +1365,11 @@ PySocketSock_makefile(PySocketSockObject *s, PyObject *args)
|
||||||
SOCKETCLOSE(fd);
|
SOCKETCLOSE(fd);
|
||||||
return s->errorhandler();
|
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);
|
f = PyFile_FromFile(fp, "<socket>", mode, fclose);
|
||||||
if (f != NULL)
|
if (f != NULL)
|
||||||
PyFile_SetBufSize(f, bufsize);
|
PyFile_SetBufSize(f, bufsize);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue