From 5ca7121fd82a19886bdd3a2d0f8e4ef06c17d28c Mon Sep 17 00:00:00 2001 From: Cristian Date: Thu, 23 Jul 2020 10:22:36 -0500 Subject: [PATCH] refactor: Change path calculation to use pathlib in a better way --- archivebox/index/json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archivebox/index/json.py b/archivebox/index/json.py index 7bf043c3..21a732fd 100644 --- a/archivebox/index/json.py +++ b/archivebox/index/json.py @@ -55,7 +55,7 @@ def parse_json_main_index(out_dir: str=OUTPUT_DIR) -> Iterator[Link]: yield Link.from_json(link_json) except KeyError: try: - detail_index_path = Path(f"{OUTPUT_DIR}/{ARCHIVE_DIR_NAME}/{link_json['timestamp']}") + detail_index_path = Path(OUTPUT_DIR) / ARCHIVE_DIR_NAME / link_json['timestamp'] yield parse_json_link_details(str(detail_index_path)) except KeyError: print(" {lightyellow}! Failed to retrieve index from {}. The index may be corrupt.".format(detail_index_path, **ANSI))