mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-01-31 15:19:10 +00:00
fix: "open in explorer" opens correct folder (#603)
* replaced as_posix with str * replaced addition with f string --------- Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user