Skip to content

gh-80504: Always show the full search path in IDLE Find in Files#152740

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-80504-grep-full-path
Open

gh-80504: Always show the full search path in IDLE Find in Files#152740
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-80504-grep-full-path

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 1, 2026

Copy link
Copy Markdown
Member

When Find in Files is opened from an unsaved editor, the Shell, or an Output window, io.filename is empty, so the "In files:" field started as a bare *.py (os.path.join("", "*.py")). There was then no way to tell from the grep output which directory was actually searched.

The pattern computation is factored into a module-level default_glob() that makes the directory absolute (os.path.abspath, which maps "" to the current directory and is idempotent on real paths), so the field always contains a full directory path. This matches what saved editor files already showed.

Requested by Terry Reedy in the issue. The added non-GUI test covers the no-path, full-path, and non-.py cases.

🤖 Generated with Claude Code

The "In files:" field of the Find in Files dialog now always contains a
full directory path, so the grep output shows which directory was searched.
@serhiy-storchaka serhiy-storchaka 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 Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant