--- a/src/eric7/Project/Project.py Wed Apr 10 16:45:06 2024 +0200 +++ b/src/eric7/Project/Project.py Thu Apr 11 09:43:05 2024 +0200 @@ -5571,12 +5571,10 @@ dirs = [""] if recursiveSearch else self.subdirs[:] + [""] for directory in dirs: - skip = False - for ignore_pattern in ignore_patterns: - if fnmatch.fnmatch(directory, ignore_pattern): - skip = True - break - if skip: + if any( + fnmatch.fnmatch(directory, ignore_pattern) + for ignore_pattern in ignore_patterns + ): continue curpath = os.path.join(self.ppath, directory) @@ -5611,14 +5609,28 @@ filetype = "" bfn = os.path.basename(fn) - for pattern in sorted(self.__pdata["FILETYPES"], reverse=True): + + # check against ignore patterns first (see issue 553) + if any( + fnmatch.fnmatch(bfn, ignore_pattern) + for ignore_pattern in ignore_patterns + ): + continue + + for pattern in self.__pdata["FILETYPES"]: if fnmatch.fnmatch(bfn, pattern): filetype = self.__pdata["FILETYPES"][pattern] break if ( filetype in self.getFileCategories() - and fn not in self.__pdata[filetype] + and ( + fn not in self.__pdata[filetype] + and ( + filetype == "OTHERS" + and os.path.dirname(fn) not in self.__pdata["OTHERS"] + ) + ) and ( filetype != "TRANSLATIONS" or (