From ba01261e4dba6397f104bc41a5ace5360a899cfe Mon Sep 17 00:00:00 2001 From: Mathias Goncalves Date: Fri, 13 Jun 2025 16:45:32 -0400 Subject: [PATCH] fix: catch potenial oserror from getpass.getuser --- nipype/pipeline/plugins/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/pipeline/plugins/tools.py b/nipype/pipeline/plugins/tools.py index 7e066b0ea3..3c263205fd 100644 --- a/nipype/pipeline/plugins/tools.py +++ b/nipype/pipeline/plugins/tools.py @@ -52,7 +52,7 @@ def report_crash(node, traceback=None, hostname=None): timeofcrash = strftime("%Y%m%d-%H%M%S") try: login_name = getpass.getuser() - except KeyError: + except (KeyError, OSError): login_name = f"UID{os.getuid():d}" crashfile = f"crash-{timeofcrash}-{login_name}-{name}-{uuid.uuid4()}" crashdir = node.config["execution"].get("crashdump_dir", os.getcwd())