MCPcopy
hub / github.com/ArchiveBox/ArchiveBox / get_system_user

Function get_system_user

archivebox/config.py:366–383  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

364############################## Version Config ##################################
365
366def get_system_user():
367 SYSTEM_USER = getpass.getuser() or os.getlogin()
368 try:
369 import pwd
370 return pwd.getpwuid(os.geteuid()).pw_name or SYSTEM_USER
371 except KeyError:
372 # Process' UID might not map to a user in cases such as running the Docker image
373 # (where `archivebox` is 999) as a different UID.
374 pass
375 except ModuleNotFoundError:
376 # pwd doesn't exist on windows
377 pass
378 except Exception:
379 # this should never happen, uncomment to debug
380 # raise
381 pass
382
383 return SYSTEM_USER
384
385def get_version(config):
386 try:

Callers 1

config.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected