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

Failure to notice bad quoting syntax #6038

Closed
llamafilm opened this issue Jun 20, 2024 · 2 comments
Closed

Failure to notice bad quoting syntax #6038

llamafilm opened this issue Jun 20, 2024 · 2 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@llamafilm
Copy link

Type: Bug

Behaviour

Given this python code:

block = {'id': 123}
print(f'parent=="{block['id']}"')

That causes SyntaxError: f-string: unmatched '['

But the VS Code extension does not flag it as an error.

Extension version: 2023.20.0
VS Code version: Code 1.90.1 (Universal) (611f9bfce64f25108829dd295f54a6894e87339d, 2024-06-11T21:02:41.372Z)
OS version: Darwin arm64 22.6.0
Modes:
Remote OS version: Linux x64 6.5.0-1020-aws

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.0
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
JavaScript Debugger ms-vscode.js-debug 1.90.0
Pylance ms-python.vscode-pylance 2024.6.1
Python ms-python.python 2024.8.1
Python Debugger ms-python.debugpy 2024.6.0
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.9
System Info
Item Value
CPUs Apple M2 Pro (12 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.07GB free)
Process Argv . --crash-reporter-id 11e589b2-48d6-4af6-9407-725f0132c526
Screen Reader no
VM 0%
Item Value
Remote SSH: %msenetbox,prod
OS Linux x64 6.5.0-1020-aws
CPUs Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz (2 x 0)
Memory (System) 7.63GB (4.63GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythonregdiag2:30936856
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
jchc7451:31067544
chatpanelc:31048052
dsvsc021:30996838
0ee40948:31013168
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
dwnewjupyter:31046869
2f103344:31071589
legacy_priority:31077528

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Jun 20, 2024
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jun 20, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Jun 20, 2024

Thanks for the issue. This error is actually enabled if you turn on basic type checking:

"python.analysis.typeCheckingMode" : "basic"

image

In the default "off", this isn't flagged as an error.

@rchiodo rchiodo closed this as completed Jun 20, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Jun 20, 2024

Alternatively that is valid syntax in 3.12, so you could switch to 3.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants