Skip to content

bpo-14916: use specified tokenizer fd for file input #31006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 1, 2022

Conversation

pmp-p
Copy link
Contributor

@pmp-p pmp-p commented Jan 29, 2022

@pablogsal, sorry i failed to rebase to main, so i recreated #22190 (comment)

PyRun_InteractiveOne*() functions allow to explicitily set fd instead of stdin.
but stdin was hardcoded in readline call.

This patch does not fix target file for prompt unlike original bpo one : prompt fd is unrelated to tokenizer source which could be read only. It is more of a bugfix regarding the docs : actual documentation say "prompt the user" so one would expect prompt to go on stdout not a file for both PyRun_InteractiveOne*() and PyRun_InteractiveLoop*().

https://bugs.python.org/issue14916

Automerge-Triggered-By: GH:pablogsal

@pablogsal pablogsal added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Feb 1, 2022
@miss-islington
Copy link
Contributor

@pmp-p: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 89b1304 into python:main Feb 1, 2022
@miss-islington
Copy link
Contributor

Thanks @pmp-p for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 1, 2022
@pablogsal, sorry i failed to rebase to main, so i recreated https://github.com/python/cpython/pull/22190GH-issuecomment-1024633392

> PyRun_InteractiveOne\*() functions allow to explicitily set fd instead of stdin.
but stdin was hardcoded in readline call.

> This patch does not fix target file for prompt unlike original bpo one : prompt fd is unrelated to tokenizer source which could be read only. It is more of a bugfix regarding the docs :  actual documentation say "prompt the user" so one would expect prompt to go on stdout not a file for both PyRun_InteractiveOne\*() and PyRun_InteractiveLoop\*().

Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit 89b1304)

Co-authored-by: Paul m. p. P <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Feb 1, 2022
@bedevere-bot
Copy link

GH-31065 is a backport of this pull request to the 3.10 branch.

@miss-islington
Copy link
Contributor

Sorry, @pmp-p, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 89b13042fcfc95bae21a49806a205ef62f1cdd73 3.9

@miss-islington miss-islington self-assigned this Feb 1, 2022
miss-islington added a commit that referenced this pull request Feb 3, 2022
@pablogsal, sorry i failed to rebase to main, so i recreated https://github.com/python/cpython/pull/22190GH-issuecomment-1024633392

> PyRun_InteractiveOne\*() functions allow to explicitily set fd instead of stdin.
but stdin was hardcoded in readline call.

> This patch does not fix target file for prompt unlike original bpo one : prompt fd is unrelated to tokenizer source which could be read only. It is more of a bugfix regarding the docs :  actual documentation say "prompt the user" so one would expect prompt to go on stdout not a file for both PyRun_InteractiveOne\*() and PyRun_InteractiveLoop\*().

Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit 89b1304)

Co-authored-by: Paul m. p. P <[email protected]>
pmp-p added a commit to pmp-p/cpython that referenced this pull request Apr 12, 2022
pablogsal pushed a commit that referenced this pull request Jul 16, 2022
)

* bpo-14916: interactive fd is not always stdin

related to #31006 merged bugfix

following https://bugs.python.org/issue14916

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
@ZeroIntensity ZeroIntensity removed the needs backport to 3.9 only security fixes label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants