From: Michael W. Hudson Date: Fri, 23 Aug 2002 16:27:40 +0000 (+0000) Subject: backport gvanrossum's checkin of X-Git-Tag: v2.2.2b1~197 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c548fbf940dab7566b88a988868e8025de9aef1b;p=thirdparty%2FPython%2Fcpython.git backport gvanrossum's checkin of revision 2.234 of posixmodule.c SF bug 563750 (Alex Martelli): posix_tmpfile(): The file returned by tmpfile() has mode w+b, so use that in the call to PyFile_FromFile(). Bugfix candidate. --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index e2d511410f6a..59c3efd15022 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -4478,7 +4478,7 @@ posix_tmpfile(PyObject *self, PyObject *args) fp = tmpfile(); if (fp == NULL) return posix_error(); - return PyFile_FromFile(fp, "", "w+", fclose); + return PyFile_FromFile(fp, "", "w+b", fclose); } #endif