This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients cheryl.sabella, terry.reedy
Date 2019-03-17.04:52:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1552798363.11.0.976568823374.issue36323@roundup.psfhosted.org>
In-reply-to
Content
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 #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.
History
Date User Action Args
2019-03-17 04:52:43terry.reedysetrecipients: + terry.reedy, cheryl.sabella
2019-03-17 04:52:43terry.reedysetmessageid: <1552798363.11.0.976568823374.issue36323@roundup.psfhosted.org>
2019-03-17 04:52:43terry.reedylinkissue36323 messages
2019-03-17 04:52:42terry.reedycreate