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 Al.Sweigart, cheryl.sabella, terry.reedy
Date 2019-02-24.06:07:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550988428.03.0.522408520162.issue23205@roundup.psfhosted.org>
In-reply-to
Content
Findfiles was more like os.walk than os.listdir.  os.walk now uses os.scandir instead of os.listdir.  From 3.7.2 doc:

"By default, errors from the scandir() call are ignored. If optional argument onerror is specified, it should be a function; it will be called with one argument, an OSError instance. It can report the error to continue with the walk, or raise the exception to abort the walk. Note that the filename is available as the filename attribute of the exception object."

We should delete the try: except: and pass in a function to print the name and error message.  This could be done after getting a working patch.

Defaults are not needed as findfiles is called with 3 positional args.  The calling method should do the replacement of '' with os.curdir().

The patch must be incomplete as generators do not have a sort method.  Replace the first 3 lines of grep_it with

        folder, filepat = os.path.split(path)
        if not folder:
            folder = os.curdir()
        filelist = sorted(findfiles(folder, filepat, self.recvar.get())

and replace 'list' with 'filelist' in the following code.

Cheryl, grab the issue if you want to do this.
History
Date User Action Args
2019-02-24 06:07:08terry.reedysetrecipients: + terry.reedy, Al.Sweigart, cheryl.sabella
2019-02-24 06:07:08terry.reedysetmessageid: <1550988428.03.0.522408520162.issue23205@roundup.psfhosted.org>
2019-02-24 06:07:08terry.reedylinkissue23205 messages
2019-02-24 06:07:07terry.reedycreate