-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
MONAI/monai/config/deviceconfig.py
Lines 103 to 110 in 6f5005f
| masked_file_path = re.sub( | |
| r"/home/\w+/", | |
| "/home/<username>/", | |
| re.sub( | |
| r"/Users/\w+/", | |
| "/Users/<username>/", | |
| re.sub(r"C:\\Users\\\w+\\", r"C:\\Users\\<username>\\", monai.__file__), | |
| ), |
if home directories are in other locations, eg. networked directories, the regex patterns won't match. I'd suggest a more thorough approach is to get the username with
getpass.getuser() or os.path.basename(os.path.expanduser("~")) then replace all instances of that string in the output with "". This will catch more places but will miss paths that might contain other identifying names, but these should be very rare.
Originally posted by @ericspod in #6913 (comment)