comparison roundup/logcontext.py @ 8450:df9fc9080e5a

fix: use getloing value --unknown-- on error. In case there is a real user with name unknown, Unlikely for account to to have dashes in name.
author John Rouillard <rouilj@ieee.org>
date Wed, 17 Sep 2025 01:33:09 -0400
parents 756cdf8e34f2
children b09ef85f0da6
comparison
equal deleted inserted replaced
8449:756cdf8e34f2 8450:df9fc9080e5a
153 reason = args[1].get_header('message-id', "no_message_id") 153 reason = args[1].get_header('message-id', "no_message_id")
154 elif location == "admin": 154 elif location == "admin":
155 try: 155 try:
156 login = os.getlogin() 156 login = os.getlogin()
157 except OSError: 157 except OSError:
158 login = "unknown" 158 login = "--unknown--"
159 reason = "roundup-admin(%s): %s" % (login, args[1][:2]) 159 reason = "roundup-admin(%s): %s" % (login, args[1][:2])
160 elif location.startswith("file://"): 160 elif location.startswith("file://"):
161 reason = location 161 reason = location
162 elif location == "client_main" and 'REQUEST_URI' in args[0].env: 162 elif location == "client_main" and 'REQUEST_URI' in args[0].env:
163 reason = args[0].env['REQUEST_URI'] 163 reason = args[0].env['REQUEST_URI']

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