mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-18 00:54:26 -04:00
ignore errors while getting system user name
This commit is contained in:
parent
ffe2968e4f
commit
5c1a14e4f2
1 changed files with 8 additions and 0 deletions
|
@ -57,9 +57,17 @@ SYSTEM_USER = getpass.getuser() or os.getlogin()
|
||||||
try:
|
try:
|
||||||
import pwd
|
import pwd
|
||||||
SYSTEM_USER = pwd.getpwuid(os.geteuid()).pw_name or SYSTEM_USER
|
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:
|
except ModuleNotFoundError:
|
||||||
# pwd is only needed for some linux systems, doesn't exist on windows
|
# pwd is only needed for some linux systems, doesn't exist on windows
|
||||||
pass
|
pass
|
||||||
|
except Exception:
|
||||||
|
# this should never happen, uncomment to debug
|
||||||
|
# raise
|
||||||
|
pass
|
||||||
|
|
||||||
############################### Config Schema ##################################
|
############################### Config Schema ##################################
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue