Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE grep: always display full search path #80504

Open
terryjreedy opened this issue Mar 17, 2019 · 4 comments
Open

IDLE grep: always display full search path #80504

terryjreedy opened this issue Mar 17, 2019 · 4 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@terryjreedy
Copy link
Member

BPO 36323
Nosy @terryjreedy, @eamanu, @csabella

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/terryjreedy'
closed_at = None
created_at = <Date 2019-03-17.02:48:55.668>
labels = ['3.8', 'expert-IDLE', 'type-bug', '3.7']
title = 'IDLE: always display full grep path'
updated_at = <Date 2019-03-21.04:50:10.321>
user = 'https://github.com/terryjreedy'

bugs.python.org fields:

activity = <Date 2019-03-21.04:50:10.321>
actor = 'terry.reedy'
assignee = 'terry.reedy'
closed = False
closed_date = None
closer = None
components = ['IDLE']
creation = <Date 2019-03-17.02:48:55.668>
creator = 'terry.reedy'
dependencies = []
files = []
hgrepos = []
issue_num = 36323
keywords = []
message_count = 4.0
messages = ['338115', '338118', '338468', '338525']
nosy_count = 3.0
nosy_names = ['terry.reedy', 'eamanu', 'cheryl.sabella']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'test needed'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue36323'
versions = ['Python 3.7', 'Python 3.8']

@terryjreedy
Copy link
Member Author

The second line of the Find in Files dialog is
In files: [____________________________________]
When this is opened in the startup directory, Shell or an untitled editor, the entry starts as '*.py'. When this is opened in an titled editor file, the initial entry is the full path. A full path is much more useful and should always be given.

@terryjreedy terryjreedy added 3.7 (EOL) end of life 3.8 only security fixes labels Mar 17, 2019
@terryjreedy terryjreedy self-assigned this Mar 17, 2019
@terryjreedy terryjreedy added topic-IDLE type-bug An unexpected behavior, bug, or error labels Mar 17, 2019
@terryjreedy
Copy link
Member Author

To be more exact, if 'Find in Files' is called in an unsaved editor window, including Output windows, the the entry starts as '*.py'. I presume that this is relative to the current working directory, which is initially the startup directory. But this can change in an undocumented way. There is currently no way in a grep output to determine which directory was searched. This is especially annoying when there are no hits and one knows that there should be some.

My initial thought was to prefix '*.py' with the directory of sys.executable. os.getcwd() might be more useful. This would be in GrepDialog.open. This will still be untested after PR12203 for bpo-23205.
Most of this method is self-free path manipulation that can be pulled into a module method and separately tested.

PR12203 adds os.curdir ('.') to no-directory patterns. After this issue, that will not be necessary unless a user deletes the explicit directory. I am pausing a PR for this issue until I finish reviewing that one and it is merged.

In the long run, I might like to separate the 'In files' glob path into 'Directory' and file glob pattern. (On Windows at least, glob patterns are not allowed in the directory part of the pattern.)

A related improvement would be listing the base search directory once at the top of output windows and not repeat it on every hit line. This would require revising the GoTo File/Line function.

@csabella
Copy link
Contributor

See also bpo-21960. I'm going to close that one in favor of this issue.

@terryjreedy
Copy link
Member Author

Thanks. I somehow never marked it for IDLE. Using groupby components, I discovered another +-10 and marked them and included in my list.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@terryjreedy terryjreedy changed the title IDLE: always display full grep path IDLE grep: always display full search path Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life 3.8 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error
Projects
Status: No status
Development

No branches or pull requests

2 participants