``` $ ./configure --ninja Node.js configure: Found Python 3.12.0... <string>:29: SyntaxWarning: invalid escape sequence '\P' INFO: configure completed successfully ``` @nodejs/python
Activity
targos commentedon Nov 11, 2023
There are also warnings in V8 during build (this should be fixed upstream):
cclauss commentedon Nov 12, 2023
This is a warning about Python
raw strings...'\P'-->r'\P''\s'-->r'\s'I am high in the mountains and running out of batteries so I cannot create a pull request.
These are Warnings, not Errors but should be fixed.
targos commentedon Nov 12, 2023
I can't find where the warning is coming from. There is no
\Psequence in any.pyfile in the project.targos commentedon Nov 13, 2023
Our problem was in a gyp file: #50695
V8 CL: https://chromium-review.googlesource.com/c/v8/v8/+/5018593
MrJithil commentedon Nov 13, 2023
The warning
<string>:29: SyntaxWarning: invalid escape sequence '\P'is caused by the below line.node/deps/openssl/openssl_common.gypi
Line 29 in 6322d4f
targos commentedon Nov 13, 2023
@MrJithil Yes, that's what I fixed in #50695
MrJithil commentedon Nov 13, 2023
We could either ignore this warning using
warnings.filterwarningsOr we need to modify the file opening logics to read contents as raw text or proper escapes.
Since this is coming from the dependancy, I prefer to ignore this specific warning. Because, I am confused on escaping every deps file is good or not.
To ignore this warning
warnings.filterwarnings("ignore", r"invalid escape sequence", category=SyntaxWarning)at the top of theconfigure.pyMrJithil commentedon Nov 13, 2023
I drafted this comment early today, and submitted now. Thanks for that.
cclauss commentedon Nov 13, 2023
The warning is useful and it should not be ignored. It will become a SyntaxError in the future so let's solve instead of hide.
https://docs.python.org/3.12/whatsnew/3.12.html#other-language-changes
deps: escape Python strings correctly
deps: escape Python strings correctly
deps: escape Python strings correctly
deps: escape Python strings correctly
deps: escape Python strings correctly