-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
tools: fix regex strings in Python tools #46585
Conversation
Review requested:
|
Changes in |
OK, so please upstream it, whatever it means ;-) |
@nodejs/python |
@josusky thanks for this contribution, the meaning is you need to get the change into v8 (following their contribution guide), then if the change is accepted it will automatically be pulled into node |
For clarity: That only applies to the change to |
I do not understand the reason for this pull request. Regex loves raw strings in Python. They are recommended in Python docs.
Why change from one string to another If two strings are equal to each other?
Please provide example code and a stack trace for where each of these raw strings generates a Python SyntaxError. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide example code and a stack trace for where each of these raw strings generates a Python SyntaxError.
The point is that in your code you sometimes do not use raw strings. Just look at the code that I have changed. If your python is old enough or not set to report all errors you may not notice the problem, but sooner or later, the deprecated constructions like
and run it like this
|
Pull request was landed without a full CI run or metadata in the commit message. I force-pushed |
@targos I am a bit lost. I can certainly create a new PR with the same code change but what should be then the difference to this one? |
This one was already merged, so we cannot merge it again. |
Fair enough, the new PR is #46649 |
tools: fix regex strings in Python tools
Strings used to construct regular expressions shall be marked as raw
otherwise newer versions of Python throw "SyntaxError" because of
invalid escape sequences.