fix(SU2_PY): improve Python wrapper reliability and remove invalid-escape warnings #2650
+14
−12
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.
Proposed Changes
This PR contains small, behavior-preserving fixes in SU2’s Python tooling:
SU2_PY/SU2/run/interface.py: makerun_command()safer and more reliable by usingcommunicate()to avoid stderr pipe deadlocks, improving stderr decoding robustness, and fixing a wrong “Path = …” diagnostic.SU2_PY/OptimalPropeller.py: use raw strings for matplotlib labels to avoid invalid escape sequence warnings and ensure LaTeX-like labels render correctly.SU2_PY/parallel_computation_fsi.py: remove a duplicated assignment in solution merge setup.Issues found and fixed (tool-related)
SU2_PY/SU2/run/interface.py–run_command()robustnesswait()+stderr.read()tocommunicate()(drains stderr while the process runs).errors="replace") to avoid wrapper crashes on non-UTF8 output (common on Windows).os.path.abspath(",")→os.path.abspath(".")).SU2_PY/OptimalPropeller.py– invalid escape sequence warningsSyntaxWarning: invalid escape sequenceand render as intended.SU2_PY/parallel_computation_fsi.py– redundant assignmentconfig.SOLUTION_FILENAME = config.RESTART_FILENAMEline (no behavior change, but prevents confusion and keeps merge setup consistent).Reasoning / Impact
Validation
python -m compileall SU2_PYsucceeds.