FIX Inkscape version detection when diagnostic messages precede version output#624
Merged
Merged
Conversation
…sion line Agent-Logs-Url: https://github.com/gallantlab/pycortex/sessions/88b00075-2675-408a-9b57-c8fb6090cd91 Co-authored-by: mvdoc <6150554+mvdoc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Inkscape version detection to capture correct version string
Fix Inkscape version detection when diagnostic messages precede version output
May 7, 2026
Contributor
|
@copilot add tests |
Agent-Logs-Url: https://github.com/gallantlab/pycortex/sessions/7b567817-a423-4884-b853-6877f364168d Co-authored-by: mvdoc <6150554+mvdoc@users.noreply.github.com>
Contributor
Author
Added 7 unit tests in
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On some Linux systems (e.g. CentOS/RHEL), Inkscape prints a
libgcworkaround message before the version line, causingINKSCAPE_VERSIONto be set to_INKSCAPE_GC=disableinstead of the actual version string. This breaks anyLooseVersioncomparison (e.g. insvgoverlay.get_textureandutils.add_roi), raising aTypeError.Changes
cortex/testing_utils.py—inkscape_version()output.split()[1]with line-by-line parsing of combined stdout+stderrInkscapecheck_outputtosp.run(..., check=True)to capture both streamscortex/tests/test_testing_utils.py— new unit tests forinkscape_version()covering:None1.2.2)Inkscapeline in output →NoneCalledProcessErrorpropagatedBefore — breaks when Inkscape emits extra output:
After — robust to diagnostic noise on stdout or stderr: