Skip to content

[v636][TPython] Fix LoadMacro for filenames containing special characters#22179

Merged
guitargeek merged 1 commit intoroot-project:v6-36-00-patchesfrom
guitargeek:bp_1
May 9, 2026
Merged

[v636][TPython] Fix LoadMacro for filenames containing special characters#22179
guitargeek merged 1 commit intoroot-project:v6-36-00-patchesfrom
guitargeek:bp_1

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)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Test Results

    17 files      17 suites   2d 9h 56m 33s ⏱️
 2 752 tests  2 752 ✅ 0 💤 0 ❌
45 199 runs  45 199 ✅ 0 💤 0 ❌

Results for commit b1eed58.

♻️ This comment has been updated with latest results.

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 merged commit 0ec0198 into root-project:v6-36-00-patches May 9, 2026
20 of 21 checks passed
@guitargeek guitargeek deleted the bp_1 branch May 9, 2026 12:28
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.

2 participants