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

SyntaxWarning in test_string_literals #131649

Closed
graingert opened this issue Mar 24, 2025 · 0 comments
Closed

SyntaxWarning in test_string_literals #131649

graingert opened this issue Mar 24, 2025 · 0 comments
Labels
tests Tests in the Lib/test dir topic-parser type-bug An unexpected behavior, bug, or error

Comments

@graingert
Copy link
Contributor

graingert commented Mar 24, 2025

Bug report

Bug description:

./python -m unittest test.test_string_literals -vvv
/home/graingert/projects/cpython/Lib/test/test_string_literals.py:180: SyntaxWarning: "\ " is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\ "? A raw string is also an option.
  eval("\"'''''''''''''''''''''invalid\ Escape\"")
/home/graingert/projects/cpython/Lib/test/test_string_literals.py:191: SyntaxWarning: "\ " is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\ "? A raw string is also an option.
  eval("\"''Incorrect \ logic?\"")
test_eval_bytes_incomplete (test.test_string_literals.TestLiterals.test_eval_bytes_incomplete) ... ok
test_eval_bytes_invalid_escape (test.test_string_literals.TestLiterals.test_eval_bytes_invalid_escape) ... ok
test_eval_bytes_invalid_octal_escape (test.test_string_literals.TestLiterals.test_eval_bytes_invalid_octal_escape) ... ok
test_eval_bytes_normal (test.test_string_literals.TestLiterals.test_eval_bytes_normal) ... ok
test_eval_bytes_raw (test.test_string_literals.TestLiterals.test_eval_bytes_raw) ... ok
test_eval_str_incomplete (test.test_string_literals.TestLiterals.test_eval_str_incomplete) ... ok
test_eval_str_invalid_escape (test.test_string_literals.TestLiterals.test_eval_str_invalid_escape) ... ok
test_eval_str_invalid_octal_escape (test.test_string_literals.TestLiterals.test_eval_str_invalid_octal_escape) ... ok
test_eval_str_normal (test.test_string_literals.TestLiterals.test_eval_str_normal) ... ok
test_eval_str_raw (test.test_string_literals.TestLiterals.test_eval_str_raw) ... ok
test_eval_str_u (test.test_string_literals.TestLiterals.test_eval_str_u) ... ok
test_file_iso_8859_1 (test.test_string_literals.TestLiterals.test_file_iso_8859_1) ... ok
test_file_latin9 (test.test_string_literals.TestLiterals.test_file_latin9) ... ok
test_file_latin_1 (test.test_string_literals.TestLiterals.test_file_latin_1) ... ok
test_file_utf8 (test.test_string_literals.TestLiterals.test_file_utf8) ... ok
test_file_utf_8 (test.test_string_literals.TestLiterals.test_file_utf_8) ... ok
test_file_utf_8_error (test.test_string_literals.TestLiterals.test_file_utf_8_error) ... ok
test_invalid_escape_locations_with_offset (test.test_string_literals.TestLiterals.test_invalid_escape_locations_with_offset) ... ok
test_template (test.test_string_literals.TestLiterals.test_template) ... ok
test_uppercase_prefixes (test.test_string_literals.TestLiterals.test_uppercase_prefixes) ... ok

CPython versions tested on:

3.12, 3.13, 3.14, CPython main branch

Operating systems tested on:

Linux

Linked PRs

@graingert graingert added the type-bug An unexpected behavior, bug, or error label Mar 24, 2025
graingert added a commit to graingert/cpython that referenced this issue Mar 24, 2025
graingert added a commit to graingert/cpython that referenced this issue Mar 24, 2025
@picnixz picnixz added tests Tests in the Lib/test dir topic-parser labels Mar 24, 2025
brianschubert pushed a commit to brianschubert/cpython that referenced this issue Mar 26, 2025
…nGH-131650)

(cherry picked from commit 2d83891)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
vstinner pushed a commit that referenced this issue Mar 26, 2025
…131766)

(cherry picked from commit 2d83891)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 26, 2025
…nGH-131650) (pythonGH-131766)

(cherry picked from commit 2d83891)
(cherry picked from commit 5bcb476)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
vstinner pushed a commit that referenced this issue Mar 26, 2025
…H-131766) (#131772)

[3.13] gh-131649: fix test_string_literals SyntaxWarning (GH-131650) (GH-131766)

(cherry picked from commit 2d83891)
(cherry picked from commit 5bcb476)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-parser type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants