Skip to content

[Bug]: Portable binary cannot open text files or LibreOffice documents on Linux #1322

@TigBuh99

Description

@TigBuh99

Checklist

  • I am using an up-to-date version.
  • I have read the documentation.
  • I have searched existing issues.

TagStudio Version

9.5.6

Operating System & Version

TUXEDO OS

Description

TagStudio version: Portable binary tagstudio_linux_x86_64_portable.tar.gz (sha256: 8158c1588d04f8a5a767bcf1a1355d4f0738b3a923e44b1acac4bdb52c56871f, released October 21, 2025)

OS: TUXEDO OS (Ubuntu/Debian base), X11 session, KDE Plasma


Description

When using the portable binary, attempting to open files in their default application fails in two different ways depending on file type:

  • Plain text files (.txt): Nothing happens at all. The log shows Opening file path=PosixPath('/path/to/file.txt') but no application is launched and no error is logged.
  • LibreOffice documents (.odt etc.): LibreOffice is triggered but receives a broken file reference, causing it to enter a crash recovery loop. Dismissing the recovery dialog is required to escape the loop.

Steps to reproduce

  1. Run the portable binary from a terminal
  2. Open a library containing .txt or .odt files
  3. Double-click a .txt file → nothing happens
  4. Double-click an .odt file → LibreOffice opens in a recovery loop

Expected behaviour

Files should open in their default application, as configured via xdg-mime. Both org.kde.kate.desktop (for text/plain) and libreoffice-writer.desktop (for application/vnd.oasis.opendocument.text) are correctly set as defaults and work fine when called via xdg-open directly from the terminal.

Terminal output

2026-02-28 22:27:29 [info     ] Opening file    path=PosixPath('/home/tigbuh/Documents/hello.txt')

(No further output — no error, no success.)

Root cause (suspected)

The portable binary is likely a PyInstaller-bundled Qt app that uses QDesktopServices::openUrl() to open files. This is a known failure mode on Linux where the bundled Qt libraries conflict with system libraries when attempting to launch external applications, causing silent failures or broken launches.

xdg-open works correctly on this system when called directly from the terminal.

Suggested fix

On Linux, use subprocess.Popen(['xdg-open', str(path)]) as the file-open mechanism instead of (or as a fallback from) QDesktopServices::openUrl(). This bypasses the bundled library conflict entirely and delegates to the system's own file association handling.

Workaround

Running TagStudio from source rather than the portable binary resolves the issue, confirming this is specific to the portable build.

Expected Behavior

Files should open in their default application, as configured via xdg-mime. Both org.kde.kate.desktop (for text/plain) and libreoffice-writer.desktop (for application/vnd.oasis.opendocument.text) are correctly set as defaults and work fine when called via xdg-open directly from the terminal.

Steps to Reproduce

  1. Run the portable binary from a terminal
  2. Open a library containing .txt or .odt files
  3. Double-click a .txt file → nothing happens
  4. Double-click an .odt file → LibreOffice opens in a recovery loop

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions