Skip to content

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

Closed

Description

@magneticflux-

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.

Activity

  1. BigBoyBarney commented on Jan 12, 2024

    @BigBoyBarney

    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?

  2. magneticflux- commented on Jan 12, 2024

    @magneticflux-
    Author

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

  3. added 2 commits that reference this issue on Jan 17, 2025
    c70ed50
    22f8903
  4. added a commit that references this issue on Mar 29, 2025
  5. added a commit that references this issue on Jun 29, 2025
    f5c18b5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions