GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-29176 Use tmpfile() in curses module by tiran · Pull Request #235 · python/cpython

Conversation

@tiran

@tiran tiran commented Feb 22, 2017

Copy link
Copy Markdown
Member

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 [email protected]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tiran tiran added the needs backport to 3.6 label Feb 22, 2017
@tiran
tiran requested a review from vstinner February 22, 2017 10:37
@tiran tiran changed the title Issue #29176: Use tmpfile() in curses module bpo-29176 Use tmpfile() in curses module Feb 22, 2017
vstinner
vstinner reviewed Feb 22, 2017
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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 :-)

#237

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Modules/_cursesmodule.c Outdated

@vstinner vstinner Feb 22, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Modules/_cursesmodule.c Outdated

@vstinner vstinner Feb 22, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tiran
tiran force-pushed the bpo29176_curses_tmpfile branch 2 times, most recently from 7b11476 to a16b7b5 Compare February 22, 2017 11:12
vstinner
vstinner approved these changes Feb 22, 2017
View reviewed changes
vstinner
vstinner requested changes Feb 22, 2017
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I missed "Issue #29176: Use tmpfile() in curses module " in the commit message.

Please replace "Issue #29176" with "bpo-29176".

Moreover, I don't think that the bugs.python.org URL is needed in the commit message.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner vstinner mentioned this pull request Feb 22, 2017
bpo-29176: curses: use tmpfile() for getwin/putwin #237
Closed
@tiran
tiran force-pushed the bpo29176_curses_tmpfile branch from a16b7b5 to 22fdd41 Compare February 22, 2017 11:26
@vstinner
vstinner requested a review from serhiy-storchaka February 22, 2017 11:26
serhiy-storchaka
serhiy-storchaka reviewed Feb 22, 2017
View reviewed changes
Comment thread Modules/_cursesmodule.c Outdated

@serhiy-storchaka serhiy-storchaka Feb 22, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be OSError.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka

serhiy-storchaka commented Feb 22, 2017

Copy link
Copy Markdown
Member

I think an entry in Misc/NEWS is required.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Feb 22, 2017

Copy link
Copy Markdown
Member

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 :-(

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tiran
tiran force-pushed the bpo29176_curses_tmpfile branch from 22fdd41 to 0e00de8 Compare February 22, 2017 12:56
@tiran
bpo-29176 Use tmpfile() in curses module
8353365
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 <[email protected]>
@tiran
tiran force-pushed the bpo29176_curses_tmpfile branch from 0e00de8 to 8353365 Compare February 22, 2017 13:04
@Mariatta Mariatta added CLA not signed and removed CLA not signed labels Feb 24, 2017
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 24, 2017
vstinner
vstinner approved these changes Mar 2, 2017
View reviewed changes
@vstinner
vstinner merged commit 2b221b7 into python:master Mar 2, 2017
@vstinner vstinner mentioned this pull request Mar 2, 2017
curses: use tempfile.TemporaryFile for get/putwin #53
Closed
yan12125 pushed a commit to yan12125/python3-android that referenced this pull request Mar 2, 2017
Yen Chi Hsuan
python: curses-tmpfile landed
e414b0f
See: python/cpython#235
@Mariatta Mariatta removed the needs backport to 3.6 label Mar 7, 2017
akruis added a commit to akruis/cpython that referenced this pull request Apr 20, 2021
@akruis
Stackless issue python#235: Fix an assertion failure caused by python…
9e4c0cf
…#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 May 27, 2021
@akruis
Stackless issue python#235: Fix an assertion failure caused by python…
5595eec
…#188

This commit fixes an assert statement, that could fail since python#188.
No functional change.
jaraco pushed a commit that referenced this pull request Dec 2, 2022
@dependabot-preview @Mariatta
Bump cherry-picker from 1.2.2 to 1.3.2 (#235)
5119463
Bumps [cherry-picker](https://github.com/python/core-workflow) from 1.2.2 to 1.3.2.
- [Release notes](https://github.com/python/core-workflow/releases)
- [Commits](python/core-workflow@cherry-picker-v1.2.2...cherry-picker-v1.3.2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka left review comments
@vstinner vstinner vstinner approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@tiran @serhiy-storchaka @vstinner @Mariatta @the-knights-who-say-ni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.