From 15e58bd366ccda6ccc02d5a28e44c81b91ad42b6 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 27 Jan 2021 11:27:40 -0500 Subject: [PATCH] fix using os.path calls on pathlib paths --- archivebox/extractors/wget.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archivebox/extractors/wget.py b/archivebox/extractors/wget.py index 15923ac3..04886575 100644 --- a/archivebox/extractors/wget.py +++ b/archivebox/extractors/wget.py @@ -180,9 +180,9 @@ def wget_output_path(link: Link) -> Optional[str]: # /some/other/url.o4g -> some binary unrecognized ext) # test this with archivebox add --depth=1 https://getpocket.com/users/nikisweeting/feed/all last_part_of_url = urldecode(full_path.rsplit('/', 1)[-1]) - for file_present in os.listdir(search_dir): + for file_present in search_dir.iterdir(): if file_present == last_part_of_url: - return os.path.join(path_from_link_dir, file_present) + return search_dir / file_present # Move up one directory level search_dir = search_dir.parent