1. python_mirrors
  2. features/pep-382-2


Michael W. Hudson  committed 8b636fc

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.

  • Participants
  • Parent commits fad071f
  • Branches 2.2

Comments (0)

Files changed (1)

File Modules/socketmodule.c

View file
  • Ignore whitespace
 		return PySocket_Err();
+#ifdef USE_GUSI2
+	/* Workaround for bug in Metrowerks MSL vs. GUSI I/O library */
+	if (strchr(mode, 'b') != NULL )
+		bufsize = 0;
 	f = PyFile_FromFile(fp, "<socket>", mode, fclose);
 	if (f != NULL)
 		PyFile_SetBufSize(f, bufsize);