-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
test added in gh-104067 has an fstring with an invalid escape sequence #105784
Comments
@mattip CPython does not issue this warning @pablogsal In 3.12 and 3.13, f-strings are not warning about invalid escapes that get warnings in real strings. This seems like a bug.
|
On python3.9.17 from Ubuntu, I get this
|
Adding an
|
Security patch #104067 was backported to 3.7, which is why it affects PyPy3.9. @ethanfurman @JelleZijlstra Do the tests added in #104067 require invalid escapes without an 'r' prefix? Or could the escape be changed or the 'r' added? |
Fixed! |
Edit: GAA, I didn't actually look at the fix: #105800 is not what I expected. |
Try as I might, I cannot get CPython3.9 to emit a
|
Relevant: #105821 |
Here it only warned/failed when bytecompile was needed, so if there wasn't a .pyc file already for test_httpservers. |
Bug report
In response to #104049, a fix and a new test were added in #104067 and related PRs. The test in test_httpserver.py uses an fstring with an escape sequence, but does not use
r
:I think the code (in two places) should be include an
r
:fr'listing for ...
On PyPy this is causing the
test___all__.py
test to fail, since it emits a warning when compiling the*.py
to*.pyc
. I am not sure why CPython is not seeing a similar problem. Perhapscompileall
is run first? Or the warning filter captures the compilation as well as the import?Your environment
The text was updated successfully, but these errors were encountered: