Skip to content

Commit ba01261

Browse files
authored
fix: catch potenial oserror from getpass.getuser
1 parent 8234ec3 commit ba01261

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nipype/pipeline/plugins/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def report_crash(node, traceback=None, hostname=None):
5252
timeofcrash = strftime("%Y%m%d-%H%M%S")
5353
try:
5454
login_name = getpass.getuser()
55-
except KeyError:
55+
except (KeyError, OSError):
5656
login_name = f"UID{os.getuid():d}"
5757
crashfile = f"crash-{timeofcrash}-{login_name}-{name}-{uuid.uuid4()}"
5858
crashdir = node.config["execution"].get("crashdump_dir", os.getcwd())

0 commit comments

Comments
 (0)