Skip to content

gh-69365: Show search pattern errors in the IDLE search dialogs - #157598

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-69365-search-error-inline
Sep 17, 2026
Merged

serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-69365-search-error-inline

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Sep 15, 2026

Copy link
Copy Markdown
Member

The Find, Replace and Find in Files dialogs now show a regular expression error in red below the entry, as the Open Module dialog does, and move the cursor to the offending character, instead of a message box that has to be dismissed first. The pattern is checked as typed, to detect ffirst error position, and a message is shown when a Find/Replace button is hit. The message is cleared when the pattern is edited. Find Again without a dialog still uses the message box.

When "Whole word" is checked, the pattern is grouped so that it is anchored on both sides. Global flags like (?i) cannot be used with "Whole word. A pattern ending with a backslash is an error instead of matching \b. Such error are reported.

🤖 Generated with Claude Code

Show the error in red below the entry and move the cursor to the
offending character in the pattern, instead of a message box. Find
Again without a dialog still uses the message box.

Check the pattern as typed, so that the position is right. This also
fixes the "Whole word" option with a regular expression: the pattern
is now grouped, so that "a|b" is anchored on both sides, and a pattern
ending with a backslash is an error instead of matching "\b".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@terryjreedy

terryjreedy commented Sep 16, 2026

Copy link
Copy Markdown
Member

Unrelated test failure: (rerunning) EDIT: PASS
Ubuntu (bolt) / build and test (ubuntu-26.04)
Warning -- test_multiprocessing_main_handling leaked temporary files (1): tmpdd3au45m

@terryjreedy terryjreedy added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Sep 17, 2026
@terryjreedy

Copy link
Copy Markdown
Member

Looks good to me. I thought about reporting an error as soon as detected, but doing that while fixing an error would be annoying. Was omitting backports an accident? I will create them but not merge immediately.

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

Yes, it was omitted by accident. Thank you for your review.

@serhiy-storchaka
serhiy-storchaka merged commit 9ab004d into python:main Sep 17, 2026
101 of 103 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. 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!

@serhiy-storchaka
serhiy-storchaka deleted the gh-69365-search-error-inline branch September 17, 2026 09:02
@bedevere-app

bedevere-app Bot commented Sep 17, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Sep 17, 2026
@bedevere-app

bedevere-app Bot commented Sep 17, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 17, 2026
@bedevere-app

bedevere-app Bot commented Sep 17, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Sep 17, 2026
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