changeset 8449:756cdf8e34f2

fix: os.getlogin fails with OSError in CI.
author John Rouillard <rouilj@ieee.org>
date Wed, 17 Sep 2025 01:31:12 -0400
parents 3df6b8988074
children df9fc9080e5a
files roundup/logcontext.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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:

Roundup Issue Tracker: http://roundup-tracker.org/