Skip to content

[v632][TPython] Fix LoadMacro for filenames containing special characters#22178

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

[v632][TPython] Fix LoadMacro for filenames containing special characters#22178
guitargeek merged 1 commit intoroot-project:v6-32-00-patchesfrom
guitargeek:bp_2

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)
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Test Results

     6 files       6 suites   19h 50m 12s ⏱️
 2 562 tests  2 562 ✅ 0 💤 0 ❌
14 957 runs  14 957 ✅ 0 💤 0 ❌

Results for commit 39a50cf.

@guitargeek guitargeek merged commit 5e34d66 into root-project:v6-32-00-patches May 8, 2026
8 of 9 checks passed
@guitargeek guitargeek deleted the bp_2 branch May 8, 2026 07:13
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