Skip to content

tools: escape Python string backslashes#19313

Open
Old-Ding wants to merge 1 commit into
apache:masterfrom
Old-Ding:codex/python-invalid-escapes
Open

tools: escape Python string backslashes#19313
Old-Ding wants to merge 1 commit into
apache:masterfrom
Old-Ding:codex/python-invalid-escapes

Conversation

@Old-Ding

@Old-Ding Old-Ding commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • use raw regex strings in the licensing helpers to avoid Python invalid escape warnings
  • escape the backslashes in the IAR project docstring path example

Verification

  • Python compile warning scan for the changed files reports TOTAL 0 for each file
  • AST comparison against origin/master reports AST_EQUAL True for the two licensing helpers
  • executable AST comparison with docstrings stripped reports AST_EQUAL_NO_DOCS True for all three changed files
  • git diff --check
  • git ls-files --eol tools/licensing/apachize.py tools/licensing/check.py tools/ide_exporter.py

I also checked for open duplicate PRs/issues mentioning invalid escape, SyntaxWarning, tools/licensing, apachize.py, and ide_exporter.py, and found no matches.

I did not run the full NuttX build/test suite locally because this Windows environment does not have CMake or a C compiler installed.

xiaoxiang781216
xiaoxiang781216 previously approved these changes Jul 6, 2026
@github-actions github-actions Bot added Area: Tooling Size: XS The size of the change in this PR is very small labels Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

hifive1-revb

@simbit18

simbit18 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@Old-Ding Please fix

a06291a2d9 tools: escape Python string backslashes
../nuttx/tools/checkpatch.sh -c -u -m -g  8b49e46b9ee7306a463107aad643c93d5b604309..HEAD
All done! ✨ 🍰 ✨
1 file would be left unchanged.
Used config files:
    1: .codespellrc
All done! ✨ 🍰 ✨
1 file would be left unchanged.
would reformat /home/runner/work/nuttx/nuttx/nuttx/tools/licensing/check.py

Oh no! 💥 💔 💥
1 file would be reformatted.

black check failed, run following command to update the style:
  $ black <src>

Some checks failed. For contributing guidelines, see:
  https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md
Error: Process completed with exit code 1.

@Old-Ding Old-Ding force-pushed the codex/python-invalid-escapes branch from 38c9564 to cdd805a Compare July 8, 2026 07:37
Python 3.14 warns about invalid escape sequences in a few tooling strings. Escape those backslashes at the Python literal layer; the licensing regex AST stays unchanged, and the IDE exporter change only corrects the docstring path example.

Run black on tools/licensing/check.py so the licensing helper matches the project formatting check.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
@Old-Ding Old-Ding force-pushed the codex/python-invalid-escapes branch from cdd805a to ae15192 Compare July 8, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Tooling Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants