Более подробная информация о проблеме на Stackoverflow:
def collate_files (old_dir, new_dir) -> str: для подпапки в old_dir.rglob (‘*. xlsx’): если subloder.match (“string_title”): .joinpath (subloder), если path.exists (new_dir): pass else: try: shutil.copy (подпапка, new_dir,), кроме Oserror как e: поднять e
Оригинал: “https://dev.to/gunteh/python-3-x-rglob-with-filenotfounderror-winerror-3-the-system-cannot-find-the-path-specified-5228”