From 70926f1d9fe725aa31fd4a8ff8c367eb6060f6c3 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Mon, 28 Oct 2024 19:06:38 -0700 Subject: [PATCH] replace os.access with os.path.isdir --- archivebox/core/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archivebox/core/views.py b/archivebox/core/views.py index a56f93bc..e425c8fe 100644 --- a/archivebox/core/views.py +++ b/archivebox/core/views.py @@ -68,7 +68,7 @@ class SnapshotView(View): and embed_path and os.access(abs_path, os.R_OK) and abs_path.exists()): - if abs_path.is_dir() and not any(abs_path.glob('*.*')): + if os.path.isdir(abs_path) and not any(abs_path.glob('*.*')): continue result_info = { @@ -102,7 +102,7 @@ class SnapshotView(View): # iterate through all the files in the snapshot dir and add the biggest ones to1 the result list snap_dir = Path(snapshot.link_dir) - assert os.access(snap_dir, os.R_OK) and os.access(snap_dir, os.X_OK) + assert os.path.isdir(snap_dir) and os.access(snap_dir, os.R_OK) for result_file in (*snap_dir.glob('*'), *snap_dir.glob('*/*')): extension = result_file.suffix.lstrip('.').lower()