Skip to content

fix: ChimeraX --cmd quoting breaks rendering#110

Merged
St3451 merged 4 commits into
masterfrom
fix/chimerax-cmd-quoting
Jun 2, 2026
Merged

fix: ChimeraX --cmd quoting breaks rendering#110
St3451 merged 4 commits into
masterfrom
fix/chimerax-cmd-quoting

Conversation

@St3451
Copy link
Copy Markdown
Collaborator

@St3451 St3451 commented Jun 2, 2026

PR #106 wrapped paths in double quotes inside the ChimeraX --cmd script to handle spaces. On some ChimeraX versions (e.g. 1.6.1) that quoting breaks the parser ("incomplete quoted text"), so every chimerax-plot render fails.

Fix: drop the quoting and instead reject paths containing characters that would break or inject into the ;-separated command — space, tab, ;, ", newline, CR — surfacing a clear error rather than a broken/injected command.

Also silences the expected log(0) RuntimeWarning (zero-score positions) via np.errstate; no behavioral change.

Copilot AI review requested due to automatic review settings June 2, 2026 14:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the ChimeraX plotting integration to build --cmd scripts using unquoted paths (to accommodate ChimeraX versions that reject quoted paths in ;-separated --cmd strings) and adds stricter path validation to prevent malformed scripts and command injection.

Changes:

  • Switched ChimeraX open/save command generation to interpolate paths unquoted in the --cmd script.
  • Expanded path validation to reject additional characters (notably whitespace) that would break ChimeraX tokenization.
  • Clarified inline documentation around subprocess execution vs. ChimeraX command parsing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/plotting/chimerax_plot.py Outdated
@St3451 St3451 changed the title fix: improve path validation and command handling for ChimeraX integr… fix: ChimeraX --cmd quoting breaks rendering Jun 2, 2026
@St3451 St3451 merged commit aceffb3 into master Jun 2, 2026
@St3451 St3451 deleted the fix/chimerax-cmd-quoting branch June 3, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants