Skip to content

fix: sanitize environment for external file openers#1391

Closed
yosofbadr wants to merge 1 commit into
TagStudioDev:mainfrom
yosofbadr:fix/1322-portable-binary-cannot-open-text-files-or-libre-office-documents-on-linu
Closed

fix: sanitize environment for external file openers#1391
yosofbadr wants to merge 1 commit into
TagStudioDev:mainfrom
yosofbadr:fix/1322-portable-binary-cannot-open-text-files-or-libre-office-documents-on-linu

Conversation

@yosofbadr

@yosofbadr yosofbadr commented Jun 16, 2026

Copy link
Copy Markdown

Summary

Draft / not ready for review.

This attempts to address #1322 by sanitizing the environment used when launching external file openers from a bundled app. In particular, it restores LD_LIBRARY_PATH from LD_LIBRARY_PATH_ORIG and removes bundled Qt/PyInstaller path variables from the subprocess environment.

I am leaving this as draft because the important validation is an end-to-end Linux portable/PyInstaller build opening files through system defaults, and I have not performed that validation. The current coverage is only targeted unit tests for the environment construction.

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM - targeted local unit test/lint only
    • Linux x86
    • Linux ARM
      • Not yet tested in the Linux portable/PyInstaller environment where the bug occurs.
  • Tested For:
    • Basic functionality - targeted subprocess environment unit tests only
    • PyInstaller executable
      • Local: uv run --extra pytest python -m pytest tests/test_silent_subprocess.py -q
      • Local: uv run --extra ruff ruff check src/tagstudio/core/utils/silent_subprocess.py tests/test_silent_subprocess.py
      • Missing before marking ready: Linux portable/PyInstaller end-to-end file-open verification.

@CyanVoxel CyanVoxel added Status: Review Needed A review of this is needed System: Linux For Linux/BSD distributions Type: Installation Installing, building, and/or launching the program Type: File System File system interactions labels Jun 16, 2026
@CyanVoxel

Copy link
Copy Markdown
Member

Hello, I've noticed that you've been opening quite a few rapid fire PRs to address open bug reports.

I've noticed a common trait amongst all of these where they're not using our designated pull request description template that includes task checkboxes for the platforms this code was tested on and the depth of what was tested. I ask you to please update your PRs with this information and include that information going forward.

Given that this PR addresses a Linux-specific issue and trying to adding environment variables to a subprocess, and #1390 (which was opened a few minutes before this one) addresses a bug that needs to be specifically tested on Windows, I am skeptical that these were tested on the applicable platforms at all.

@yosofbadr

yosofbadr commented Jun 16, 2026

Copy link
Copy Markdown
Author

You're right, and I'm sorry for the extra review burden.

What happened: I've been working on an independent OSS contribution agent to see if it can make useful open-source contributions. I'm a big fan of TagStudio, so I added it as a candidate project, but it went off in the wrong direction and started working through the TagStudio backlog too aggressively.

I've turned it off now. I'm going through the open PRs manually and will update, draft, or close anything that isn't properly scoped or tested. My intention was to help, not create more work for you.

@yosofbadr yosofbadr changed the title fix: Portable binary cannot open text files or LibreOffice documents on... fix: sanitize environment for external file openers Jun 16, 2026
@yosofbadr yosofbadr marked this pull request as draft June 16, 2026 16:12
@yosofbadr

yosofbadr commented Jun 16, 2026

Copy link
Copy Markdown
Author

I've moved this to draft. You're right that the real test here is the Linux portable/PyInstaller build opening files correctly, and I haven't verified that yet.

I'll leave it as draft unless I can test that environment properly.

@yosofbadr

Copy link
Copy Markdown
Author

Closing this after a stricter audit. The important test for this issue is the Linux portable/PyInstaller build opening files correctly, and I have not verified that environment.

Sorry for the noise.

@yosofbadr yosofbadr closed this Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Review Needed A review of this is needed System: Linux For Linux/BSD distributions Type: File System File system interactions Type: Installation Installing, building, and/or launching the program

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants