Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][clang-tidy-diff] SyntaxWarning: invalid escape sequence #92948

Closed
Jacobfaib opened this issue May 21, 2024 · 1 comment
Closed

[BUG][clang-tidy-diff] SyntaxWarning: invalid escape sequence #92948

Jacobfaib opened this issue May 21, 2024 · 1 comment

Comments

@Jacobfaib
Copy link

clang-tidy-diff.py:245: SyntaxWarning: invalid escape sequence '\+'
  match = re.search('^\+\+\+\ "?(.*?/){%s}([^ \t\n"]*)' % args.p, line)
clang-tidy-diff.py:258: SyntaxWarning: invalid escape sequence '\+'
  match = re.search("^@@.*\+(\d+)(,(\d+))?", line)

Using python:

$ python3 -VV
Python 3.12.3 (main, Apr  9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)]

It seems these strings need to be raw strings:

match = re.search(r'^\+\+\+\ "?(.*?/){%s}([^ \t\n"]*)' % args.p, line)
#                 ^ note
@Jacobfaib Jacobfaib changed the title [BUG][clang-tidy] SyntaxWarning: invalid escape sequence [BUG][clang-tidy-diff] SyntaxWarning: invalid escape sequence May 21, 2024
@PiotrZSL PiotrZSL linked a pull request May 21, 2024 that will close this issue
@5chmidti
Copy link
Contributor

Fixed by #94028

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants