mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-06-02 23:59:52 -04:00
switch .is_dir and .exists for os.access to avoid PermissionError on startup
This commit is contained in:
parent
c3dd0f22e5
commit
de2ab43f7f
22 changed files with 119 additions and 97 deletions
|
@ -249,7 +249,7 @@ def load_main_index(out_dir: Path | str=DATA_DIR, warn: bool=True) -> List[Link]
|
|||
@enforce_types
|
||||
def load_main_index_meta(out_dir: Path=DATA_DIR) -> Optional[dict]:
|
||||
index_path = out_dir / CONSTANTS.JSON_INDEX_FILENAME
|
||||
if index_path.exists():
|
||||
if os.access(index_path, os.F_OK):
|
||||
with open(index_path, 'r', encoding='utf-8') as f:
|
||||
meta_dict = pyjson.load(f)
|
||||
meta_dict.pop('links')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue