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

Pyright does not catch SyntaxError: unterminated f-string literal #9789

Open
namanarora42 opened this issue Jan 29, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@namanarora42
Copy link

Environment data

  • Language Server version: 2024.11.1
  • OS and version: win32 x64
  • Python version (and distribution if applicable, e.g. Anaconda): 3.12.7
  • python.analysis.indexing: true
  • python.analysis.typeCheckingMode: off

Code Snippet

a = (f'hello
     there')

print(a)

Repro Steps

  1. Type in the code snippet as-is into an empty .py file.
  2. Observe the "Problems" window for warnings/issues raised

Expected behavior

Pylance should highlight the syntax error in the first line. When you run this script, Python throws the below error:

SyntaxError: unterminated f-string literal (detected at line 1)

Pylance should be able to catch this error. For example, I tried typing the same snippet into PyCharm Community Edition, and it correctly identifies the errors (see screenshot)

Correct Behavior Example from PyCharm

Actual behavior

Pylance does not report any problems with this code.

Logs

2025-01-29 15:12:34.565 [info] Send text to terminal: C:/Users/XXX/AppData/Local/Programs/Python/Python312/python.exe d:/Projects/XXX/Sandbox/test.py
@rchiodo rchiodo transferred this issue from microsoft/pylance-release Jan 29, 2025
@rchiodo rchiodo changed the title Pylance does not catch SyntaxError: unterminated f-string literal Pyright does not catch SyntaxError: unterminated f-string literal Jan 29, 2025
@rchiodo rchiodo removed their assignment Jan 29, 2025
@erictraut erictraut added the bug Something isn't working label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants