From b854884c568be51273b7d9a2cb3f902d2a2d4985 Mon Sep 17 00:00:00 2001 From: apkallum Date: Thu, 23 Jul 2020 11:50:42 -0400 Subject: [PATCH] move umask to init/__config__ --- archivebox/config/__init__.py | 2 ++ archivebox/main.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/archivebox/config/__init__.py b/archivebox/config/__init__.py index e1a99c99..140769db 100644 --- a/archivebox/config/__init__.py +++ b/archivebox/config/__init__.py @@ -864,3 +864,5 @@ def setup_django(out_dir: str=None, check_db=False, config: ConfigDict=CONFIG) - f'No database file {SQL_INDEX_FILENAME} found in OUTPUT_DIR: {config["OUTPUT_DIR"]}') except KeyboardInterrupt: raise SystemExit(2) + +os.umask(0o777 - int(OUTPUT_PERMISSIONS, base=8)) diff --git a/archivebox/main.py b/archivebox/main.py index 2c492ee2..cd6c7492 100644 --- a/archivebox/main.py +++ b/archivebox/main.py @@ -87,7 +87,6 @@ from .config import ( CONFIG, USER_CONFIG, get_real_name, - OUTPUT_PERMISSIONS ) from .logging_util import ( TERM_WIDTH, @@ -241,7 +240,6 @@ def run(subcommand: str, @enforce_types def init(force: bool=False, out_dir: str=OUTPUT_DIR) -> None: """Initialize a new ArchiveBox collection in the current directory""" - os.umask(0o777 - int(OUTPUT_PERMISSIONS, base=8)) os.makedirs(out_dir, exist_ok=True) is_empty = not len(set(os.listdir(out_dir)) - ALLOWED_IN_OUTPUT_DIR) existing_index = os.path.exists(os.path.join(out_dir, JSON_INDEX_FILENAME))