mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2024-07-30 21:27:34 +00:00
Windows: fix files w/ spaces opening cmd rather than associated program
This commit is contained in:
parent
00651e6242
commit
1f7a5d3cbb
1 changed files with 2 additions and 1 deletions
|
@ -68,7 +68,8 @@ QSettings.setPath(QSettings.IniFormat, QSettings.UserScope, os.getcwd())
|
|||
def open_file(path: str):
|
||||
try:
|
||||
if sys.platform == "win32":
|
||||
subprocess.Popen(["start", path], shell=True, close_fds=True, creationflags=subprocess.DETACHED_PROCESS)
|
||||
# Windows needs special attention to handle spaces in the file
|
||||
subprocess.Popen(["start", f'"{path.replace('"', '\"')}"'], shell=True, close_fds=True, creationflags=subprocess.DETACHED_PROCESS)
|
||||
else:
|
||||
if sys.platform == "darwin":
|
||||
command_name = "open"
|
||||
|
|
Loading…
Reference in a new issue