Skip to content

Commit d152cd7

Browse files
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>
1 parent 20f9371 commit d152cd7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tagstudio/src/qt/helpers/file_opener.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ def open_file(path: str | Path, file_manager: bool = False):
3131

3232
try:
3333
if sys.platform == "win32":
34-
normpath = Path(path).resolve().as_posix()
34+
normpath = str(Path(path).resolve())
3535
if file_manager:
3636
command_name = "explorer"
37-
command_arg = '/select,"' + normpath + '"'
37+
command_arg = f'/select,"{normpath}"'
38+
3839
# For some reason, if the args are passed in a list, this will error when the
3940
# path has spaces, even while surrounded in double quotes.
4041
subprocess.Popen(

0 commit comments

Comments
 (0)