mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
7f147a772d
commit
db9198a8b5
2 changed files with 2 additions and 2 deletions
|
@ -5194,7 +5194,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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue