Skip to content

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commented Jun 26, 2024

When testing IDLE, don't create a Tk to avoid side effects such as installing a PyOS_InputHook hook.

When testing IDLE, don't create a Tk to avoid side effects such as installing a PyOS_InputHook hook.
@vstinner
Copy link
MemberAuthor

Without this change, ./python -m test -u all,-gui test_idle test_pyrepl hangs on Linux: it is blocked until I press ENTER.

With this change, the same command no longer hangs.

Copy link
Contributor

@ambvambv left a comment

Choose a reason for hiding this comment

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

Fixes the issue for me on Ubuntu and macOS, both GUI builds. Tests pass with:

> /Volumes/RAMDisk/installed-main/bin/python3 -E -Wd -m test --slowest --fail-env-changed -uall test_idle test_pyrepl Using random seed: 2738848300 Raised RLIMIT_NOFILE: 256 -> 1024 0:00:00 load avg: 9.16 Run 2 tests sequentially in a single process 0:00:00 load avg: 9.16 [1/2] test_idle 0:00:09 load avg: 9.14 [2/2] test_pyrepl == Tests result: SUCCESS == 10 slowest tests: - test_idle: 9.3 sec - test_pyrepl: 4.5 sec All 2 tests OK. Total duration: 13.9 sec Total tests: run=740 skipped=5 Total test files: run=2/2 Result: SUCCESS 

@vstinnervstinner merged commit 44eafd6 into python:mainJun 26, 2024
@vstinnervstinner deleted the idle branch June 26, 2024 13:41
@miss-islington-app
Copy link

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 26, 2024
When testing IDLE, don't create a Tk to avoid side effects such as installing a PyOS_InputHook hook. (cherry picked from commit 44eafd6) Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.13 bugs and security fixes label Jun 26, 2024
@vstinner
Copy link
MemberAuthor

Ok, let me merge this change and see how it goes.

Thanks for the review @ambv.

vstinner added a commit that referenced this pull request Jun 26, 2024
gh-121008: Fix idlelib.run tests (GH-121046) When testing IDLE, don't create a Tk to avoid side effects such as installing a PyOS_InputHook hook. (cherry picked from commit 44eafd6) Co-authored-by: Victor Stinner <vstinner@python.org>
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
When testing IDLE, don't create a Tk to avoid side effects such as installing a PyOS_InputHook hook.
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
When testing IDLE, don't create a Tk to avoid side effects such as installing a PyOS_InputHook hook.
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
When testing IDLE, don't create a Tk to avoid side effects such as installing a PyOS_InputHook hook.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@vstinner@ambv