diff --git a/tagstudio/src/qt/helpers/file_opener.py b/tagstudio/src/qt/helpers/file_opener.py index 0672ed84f..d402e1ded 100644 --- a/tagstudio/src/qt/helpers/file_opener.py +++ b/tagstudio/src/qt/helpers/file_opener.py @@ -31,10 +31,11 @@ def open_file(path: str | Path, file_manager: bool = False): try: if sys.platform == "win32": - normpath = Path(path).resolve().as_posix() + normpath = str(Path(path).resolve()) if file_manager: command_name = "explorer" - command_arg = '/select,"' + normpath + '"' + command_arg = f'/select,"{normpath}"' + # For some reason, if the args are passed in a list, this will error when the # path has spaces, even while surrounded in double quotes. subprocess.Popen(