bpo-29176 Use tmpfile() in curses module by tiran · Pull Request #235 · python/cpython
Conversation
The curses module used mkstemp() + fopen() to create a temporary file in
/tmp. The /tmp directory does not exist on Android. The tmpfile()
function simplifies the task a lot. It creates a temporary file in a
correct directory, takes care of cleanup and returns FILE*.
tmpfile is supported on all platforms (C89, POSIX 2001, Android,
Windows).
https://bugs.python.org/issue29176
Signed-off-by: Christian Heimes christian@python.org
tiran
changed the title
Issue #29176: Use tmpfile() in curses module
bpo-29176 Use tmpfile() in curses module
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I missed your PR and wrote exactly the same :-)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the if can now be removed
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
= NULL can be removed
Same remarks for the other function.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be OSError.
I think an entry in Misc/NEWS is required.
From an user point of view, there is no change, except of Android support.
Last days, I'm trying to avoid touching Misc/NEWS, because it's even more a mess because of how pull requests work :-(
The curses module used mkstemp() + fopen() to create a temporary file in /tmp. The /tmp directory does not exist on Android. The tmpfile() function simplifies the task a lot. It creates a temporary file in a correct directory, takes care of cleanup and returns FILE*. tmpfile is supported on all platforms (C89, POSIX 2001, Android, Windows). Signed-off-by: Christian Heimes <christian@python.org>
yan12125 pushed a commit to yan12125/python3-android that referenced this pull request
akruis added a commit to akruis/cpython that referenced this pull request
…#188 This commit fixes an assert statement, that could fail since python#188. No functional change. (cherry picked from commit 5595eec)
akruis added a commit to akruis/cpython that referenced this pull request
…#188 This commit fixes an assert statement, that could fail since python#188. No functional change.