From 7809d3cae981b259270dc888fb3c5cf64d9d1acc Mon Sep 17 00:00:00 2001 From: arshalaromal Date: Tue, 21 Jul 2026 19:35:23 +0530 Subject: [PATCH 1/3] test: trigger CI on fork for #154357 --- Lib/test/test_tkinter/test_simpledialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_tkinter/test_simpledialog.py b/Lib/test/test_tkinter/test_simpledialog.py index be0be8d3f546311..a7c02e8d1a9d917 100644 --- a/Lib/test/test_tkinter/test_simpledialog.py +++ b/Lib/test/test_tkinter/test_simpledialog.py @@ -444,7 +444,7 @@ def open(self, query, **kw): d.focus_force() d.update() return d - + # Temporary commit to trigger CI testing def enter(self, d, value, key=''): d.entry.delete(0, 'end') d.entry.insert(0, value) From 7dca6e2faa20ed30d02640e7f57ea23bada32289 Mon Sep 17 00:00:00 2001 From: arshalaromal Date: Tue, 21 Jul 2026 20:09:12 +0530 Subject: [PATCH 2/3] gh-154357: Fix race condition in test_simpledialog by explicitly setting focus to entry --- Lib/test/test_tkinter/test_simpledialog.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_tkinter/test_simpledialog.py b/Lib/test/test_tkinter/test_simpledialog.py index a7c02e8d1a9d917..6abceceb4650c37 100644 --- a/Lib/test/test_tkinter/test_simpledialog.py +++ b/Lib/test/test_tkinter/test_simpledialog.py @@ -444,11 +444,13 @@ def open(self, query, **kw): d.focus_force() d.update() return d - # Temporary commit to trigger CI testing + def enter(self, d, value, key=''): d.entry.delete(0, 'end') d.entry.insert(0, value) - d.event_generate(key) + d.entry.focus_set() + d.update_idletasks() + d.entry.event_generate(key) d.update() # --- Prompt and entry --- From cd89906fb2fc736488d0b24a897ddd4a8dbe2e2a Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 14:49:07 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lib/test/test_tkinter/test_simpledialog.py | 2 +- .../next/Library/2026-07-21-14-49-05.gh-issue-154357.YaqVLI.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2026-07-21-14-49-05.gh-issue-154357.YaqVLI.rst diff --git a/Lib/test/test_tkinter/test_simpledialog.py b/Lib/test/test_tkinter/test_simpledialog.py index 6abceceb4650c37..81f7676d6e5a2b8 100644 --- a/Lib/test/test_tkinter/test_simpledialog.py +++ b/Lib/test/test_tkinter/test_simpledialog.py @@ -444,7 +444,7 @@ def open(self, query, **kw): d.focus_force() d.update() return d - + def enter(self, d, value, key=''): d.entry.delete(0, 'end') d.entry.insert(0, value) diff --git a/Misc/NEWS.d/next/Library/2026-07-21-14-49-05.gh-issue-154357.YaqVLI.rst b/Misc/NEWS.d/next/Library/2026-07-21-14-49-05.gh-issue-154357.YaqVLI.rst new file mode 100644 index 000000000000000..b323f2bb2b078f2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-07-21-14-49-05.gh-issue-154357.YaqVLI.rst @@ -0,0 +1 @@ +Fix race condition in :mod:`tkinter.simpledialog` tests by explicitly setting focus to entry before generating events.