From 5c1a14e4f2bbd085954d480fbcc9c2f6c3a6a64e Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Thu, 14 Sep 2023 03:39:44 -0700 Subject: [PATCH] ignore errors while getting system user name --- archivebox/config.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/archivebox/config.py b/archivebox/config.py index 062b09a3..795b98e9 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -57,9 +57,17 @@ SYSTEM_USER = getpass.getuser() or os.getlogin() try: import pwd SYSTEM_USER = pwd.getpwuid(os.geteuid()).pw_name or SYSTEM_USER +except KeyError: + # Process' UID might not map to a user in cases such as running the Docker image + # (where `archivebox` is 999) as a different UID. + pass except ModuleNotFoundError: # pwd is only needed for some linux systems, doesn't exist on windows pass +except Exception: + # this should never happen, uncomment to debug + # raise + pass ############################### Config Schema ##################################