# HG changeset patch # User John Rouillard # Date 1758087072 14400 # Node ID 756cdf8e34f23aa74c0c9f1ce7f5361711f42219 # Parent 3df6b898807490c789e46729fc31f2157040ea54 fix: os.getlogin fails with OSError in CI. diff -r 3df6b8988074 -r 756cdf8e34f2 roundup/logcontext.py --- a/roundup/logcontext.py Wed Sep 17 01:05:35 2025 -0400 +++ b/roundup/logcontext.py Wed Sep 17 01:31:12 2025 -0400 @@ -152,7 +152,11 @@ elif location == "mailgw": reason = args[1].get_header('message-id', "no_message_id") elif location == "admin": - reason = "roundup-admin(%s): %s" % (os.getlogin(), args[1][:2]) + try: + login = os.getlogin() + except OSError: + login = "unknown" + reason = "roundup-admin(%s): %s" % (login, args[1][:2]) elif location.startswith("file://"): reason = location elif location == "client_main" and 'REQUEST_URI' in args[0].env: