Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Open containing folder" action uses a hard-coded path for xdg-open #726

Open
magneticflux- opened this issue Jan 12, 2024 · 2 comments · May be fixed by #727
Open

"Open containing folder" action uses a hard-coded path for xdg-open #726

magneticflux- opened this issue Jan 12, 2024 · 2 comments · May be fixed by #727
Labels

Comments

@magneticflux-
Copy link

magneticflux- commented Jan 12, 2024

The hard-coded path /usr/bin/xdg-open may not exist (such as when using NixOS), causing the "open containing folder" action to silently fail. This should simply use the appropriate $PATH entry (as with the macOS open added in #447).

Logs from a failure:

Traceback (most recent call last):
  File "/nix/store/d37h5x02hg7d43nb8rdzwf76jyz05xbn-trackma-0.8.6/lib/python3.11/site-packages/trackma/ui/gtk/window.py", line 589, in _open_folder
    subprocess.Popen(["/usr/bin/xdg-open", os.path.dirname(filename)],
  File "/nix/store/5k91mg4qjylxbfvrv748smfh51ppjq0g-python3-3.11.6/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/nix/store/5k91mg4qjylxbfvrv748smfh51ppjq0g-python3-3.11.6/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/xdg-open'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/d37h5x02hg7d43nb8rdzwf76jyz05xbn-trackma-0.8.6/lib/python3.11/site-packages/trackma/ui/gtk/window.py", line 504, in _on_show_action
    self._open_folder(*data)
  File "/nix/store/d37h5x02hg7d43nb8rdzwf76jyz05xbn-trackma-0.8.6/lib/python3.11/site-packages/trackma/ui/gtk/window.py", line 594, in _open_folder
    raise utils.EngineError("Could not open folder.")
trackma.utils.EngineError: Could not open folder.
@BigBoyBarney
Copy link

Assuming xdg-open is in $PATH, simply replacing /usr/bin/xdg-open with xdg-open should solve this, right?

Or is NixOS using something else?

@magneticflux-
Copy link
Author

Yes, it's available on the normal $PATH so just removing the absolute part should fix it.

@FichteFoll FichteFoll added the bug label Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants