Closed tylerlaprade closed 2 weeks ago
This error is a false positive. It's due to a regression that I introduced in pyright 1.1.373 (apologies for that). I fixed it in pyright 1.1.374.
we will pull in 374
soon for next prelease (this wed probably)
Sure, no worries @erictraut, bugs happen sometimes. But separately there's a bug in Pylance if it doesn't exhibit the same behavior as the CLI when both are running the same Pyright version. In this case, I have both of them on 1.1.373
.
@heejaechang, outside of this specific error, why is Pylance exhibiting different behavior than Pyright when both are on the same version?
@tylerlaprade, you may find this documentation useful.
Thanks @erictraut. I verified that both are indeed using the same underlying Pyright version, and my project has a pyrightconfig.json
, so that rules out two of the three possible issues. The only one remaining is the stubPath
. However, if they were looking at different stubs, I would have seen many more discrepancies in the past. This seems to be isolated to whether or not this particular regression is included.
@tylerlaprade we need to take a look. but pylance might have some pyright changes not released yet from pyright. that sometime happens due to how we bring in pyright changes to pylance.
please re-open if this still repro with the latest pylance with pyright.
This still repros for me. It looks like the pyright version did not get updated in this release: https://github.com/microsoft/pylance-release/blob/main/releases/latest-release.json
This still repros for me. It looks like the pyright version did not get updated in this release: https://github.com/microsoft/pylance-release/blob/main/releases/latest-release.json
Please try prerelease. Yesterday's 2024.8.2 release was a hotfix for a crash bug and did not include any other changes (ex. no Pyright upgrade).
Thanks @debonte. Prerelease is pointing at a version of Pyright after the bugfix, so I wouldn't expect it to flag the error regardless. But I'm still getting the discrepancy when on release Pylance and using the same Pyright version for both CLI and Pylance - CLI flags the error (and fails CI), while Pylance doesn't flag the error.
As @heejaechang guessed above, Pylance 2024.8.1 (and 2024.8.2) is not exactly on Pyright 1.1.373. The pyright commit hash is https://github.com/microsoft/pyright/commit/ee42447964f776ef94eaf2bd307fd58ffeef0821, which is 11 commits after 1.1.373. We generally try to align Pylance's copy of Pyright exactly on a Pyright release, but this is not always possible.
Sorry for the inconvenience.
FWIW, you can see the Pyright commit hash in the Pylance log:
2024-08-27 10:16:30.868 [info] [Info - 10:16:30 AM] (13992) Pylance language server 2024.8.1 (pyright version 1.1.373, commit ee424479) starting
Environment data
Code Snippet
npx pyright@1.1.373 . -p ../pyrightconfig.json
Expected behavior
Pylance should flag the errors that show up in the CLI
Actual behavior
Pylance doesn't have any errors
Logs