FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-140146: Fix for stdin redirection to a pipe with interactive tkinter on Windows by mdehoon · Pull Request #148819 · python/cpython · GitHub

Repository navigation

gh-140146: Fix for stdin redirection to a pipe with interactive tkinter on Windows - #148819

Merged
serhiy-storchaka merged 9 commits into
python:mainfrom
mdehoon:issue140146_fix_for_windows_pipe
Jun 29, 2026
Merged

serhiy-storchaka merged 9 commits into
python:mainfrom
mdehoon:issue140146_fix_for_windows_pipe

Conversation

mdehoon commented Apr 21, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

On Windows, EventHook in _tkinter.c will hang on Windows if Python is run with stdin redirected to a pipe. The reason is that on Windows, EventHook checks for data availability on stdin by calling _kbhit, which reports if a key was hit on the keyboard. With this patch, EventHook first checks whether stdin is a console or a pipe, and then calls either _kbhit or PeekNamedPipe, respectively, to establish if input is available on stdin.

Copy link
Copy Markdown
Member

@mdehoon, please resolve conflict.

mdehoon commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

@serhiy-storchaka

@mdehoon, please resolve conflict.

Done.

Comment thread Modules/_tkinter.c
mdehoon and others added 4 commits June 29, 2026 17:13
Adding a breaking arm for FILE_TYPE_DISK (python -i < file), as a disk file is always readable.
…AcUHA.rst

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
If the test fails, let it fail quickly.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
If the test fails, let it fail quickly.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. 👍

Thanks for handling the rebase and the follow-ups.

serhiy-storchaka enabled auto-merge (squash) June 29, 2026 08:37
serhiy-storchaka added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Jun 29, 2026
serhiy-storchaka merged commit 6d209cb into python:main Jun 29, 2026
64 checks passed

Copy link
Copy Markdown

Thanks @mdehoon for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

bedevere-app Bot commented Jun 29, 2026

Copy link
Copy Markdown

GH-152560 is a backport of this pull request to the 3.15 branch.

bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Jun 29, 2026

bedevere-app Bot commented Jun 29, 2026

Copy link
Copy Markdown

GH-152561 is a backport of this pull request to the 3.14 branch.

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 29, 2026

bedevere-app Bot commented Jun 29, 2026

Copy link
Copy Markdown

GH-152562 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jun 29, 2026
serhiy-storchaka pushed a commit that referenced this pull request Jun 29, 2026
…e tkinter on Windows (GH-148819) (GH-152562)

(cherry picked from commit 6d209cb)

Co-authored-by: mdehoon <mjldehoon@yahoo.com>
serhiy-storchaka pushed a commit that referenced this pull request Jun 29, 2026
…e tkinter on Windows (GH-148819) (GH-152561)

(cherry picked from commit 6d209cb)

Co-authored-by: mdehoon <mjldehoon@yahoo.com>
serhiy-storchaka pushed a commit that referenced this pull request Jun 29, 2026
…e tkinter on Windows (GH-148819) (GH-152560)

(cherry picked from commit 6d209cb)

Co-authored-by: mdehoon <mjldehoon@yahoo.com>
mdehoon deleted the issue140146_fix_for_windows_pipe branch July 1, 2026 07:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL