]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport gvanrossum's checkin of
authorMichael W. Hudson <mwh@python.net>
Fri, 23 Aug 2002 16:27:40 +0000 (16:27 +0000)
committerMichael W. Hudson <mwh@python.net>
Fri, 23 Aug 2002 16:27:40 +0000 (16:27 +0000)
    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.

Modules/posixmodule.c

index e2d511410f6a573ef71b8cc72433caa346758b97..59c3efd150228d543b9800d9ae3d561d2618b742 100644 (file)
@@ -4478,7 +4478,7 @@ posix_tmpfile(PyObject *self, PyObject *args)
     fp = tmpfile();
     if (fp == NULL)
         return posix_error();
-    return PyFile_FromFile(fp, "<tmpfile>", "w+", fclose);
+    return PyFile_FromFile(fp, "<tmpfile>", "w+b", fclose);
 }
 #endif