Skip to content

[v630][TPython] Fix LoadMacro for filenames containing special characters#22180

Merged
guitargeek merged 1 commit intoroot-project:v6-30-00-patchesfrom
guitargeek:bp_3
May 8, 2026
Merged

[v630][TPython] Fix LoadMacro for filenames containing special characters#22180
guitargeek merged 1 commit intoroot-project:v6-30-00-patchesfrom
guitargeek:bp_3

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

The implementation inserted the file name argument directly into a Python string literal delimited by double quotes, so any " in the name terminated the literal early and made the constructed source invalid (or, with a carefully crafted name, a different program than intended). Escape \, ", \n and \r in the name before using it, so that the whole name is used as a literal.

Also add test coverage for filenames containing these special characters.

(cherry picked from commit fac6e65)

The implementation inserted the file name argument directly into a
Python string literal delimited by double quotes, so any `"` in the name
terminated the literal early and made the constructed source invalid
(or, with a carefully crafted name, a different program than intended).
Escape `\`, `"`, `\n` and `\r` in the name before using it, so that the
whole name is used as a literal.

Also add test coverage for filenames containing these special
characters.

(cherry picked from commit fac6e65)
@guitargeek guitargeek self-assigned this May 7, 2026
@guitargeek guitargeek requested a review from Axel-Naumann as a code owner May 7, 2026 19:17
@guitargeek guitargeek requested a review from vepadulano as a code owner May 7, 2026 19:17
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Test Results

     5 files       5 suites   15h 59m 2s ⏱️
 2 476 tests  2 476 ✅ 0 💤 0 ❌
12 224 runs  12 224 ✅ 0 💤 0 ❌

Results for commit ace02034.

@guitargeek guitargeek merged commit 5524612 into root-project:v6-30-00-patches May 8, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant