Pylance using broken 1.1.401 release of pyright
Pyright 1.1.401 had a regression that afaik breaks linting of any project that has reportUnnecessaryTypeIgnoreComment enabled, because it's a linting error on its own built-in types.
https://github.com/microsoft/pyright/issues/10487
1.1.402 fixes this but it doesn't seem like there's a release of pylance with this version.
Can get please a we pylance release using 1.1.402 ASAP / not just wait for the next generally scheduled release?
@sminnee, are you wanting this to be fixed in Pylance or is the primary issue that you want to configure pyright-python to use pyright 1.1.402?
I just noticed that this is one of the _tyoe_checker_internals.pyi issues. That issue was fixed in Pylance first and then the fix was ported to pyright. So despite 2025.5.101 and later being based on Pyright 1.1.401, these Pylance builds don't have this bug.
So I think shipping a Pylance build based on Pyright 1.1.402 outside of our normal release schedule would be overkill. If you want to use Pyright 1.1.402 while waiting for Pylance to ship a release based on 1.1.402, you can configure pyright-python to target that version of pyright explicitly.
@debonte, I'm not the OP, but we're also affected by this. Our primary issue is that the Pyright action in GitHub, which we've configured to use pylance-version: latest-release, is blocking every single PR in our repository. I would loathe to change that, since it would mean our CI is out of sync with our local.
~As a random aside, I'm not sure why we don't also see these errors locally. Is it because Pylance knows not to check dependencies?~
I'm not sure why we don't also see these errors locally. Is it because Pylance knows not to check dependencies?
I believe @debonte answered this above, unless I'm missing something. This fix was first done in Pylance and was then ported to Pyright. So Pyright 1.1.401 has the bug but the latest release of Pylance doesn't.
We should be back in sync next Wednesday (when we ship a new prerelease).
I'm hoping this idea here will alleviate this sort of problem in the future: https://github.com/microsoft/pylance-release/discussions/7180
Once we have this working, Pyright and Pylance will essentially be decoupled. You'll be able to specify the exact version of Pyright you want for CI and in the IDE (while allowing Pylance to just upgrade normally). As long as the version of Pyright you want implements the TSP interface, Pylance can use it to provide language services.
Plan
After discussing our options, our plan is to:
- Ship prerelease on Wednesday (6/18) as normal. This will include Pyright 1.1.402. At that point, affected users can get back to a good state by switching to Pylance pre-release and changing their
pyright-pythonconfig tolatest-prerelease. - The following Wednesday (6/25), assuming telemetry/etc looks good for that prerelease build, we will ship a hotfix (2025.6.1 plus Pyright 1.1.402), and you can switch back to Pylance stable and
pyright-pythonwithlatest-release.
Workarounds
In the meantime, you can work around this issue by rolling Pylance back to 2025.5.1 (and disabling auto-update) and changing your pyright-python config to target Pylance 2025.5.1 (PYRIGHT_PYTHON_PYLANCE_VERSION=2025.5.1). This will give you the behavior that you had yesterday before Pylance 2025.6.1 shipped.
Alternatively, you can change your pyright-python config to explicitly target Pyright 1.1.402. This would unblock you, but would mean that when using the latest Pylance release you might see differences in behavior vs. CI.
Rejected options
Here are the other options we considered:
-
Ship a new stable release (hotfix) that uses Pyright 1.1.402 ---- The vast majority of our users (99%?) use our stable releases though, and upgrading all of them to Pyright 1.1.402 without any testing/bake time would be irresponsible.
-
Ship a new prerelease build that uses Pyright 1.1.402 ---- Our dev branch unfortunately has a big, potentially destabilizing change in it at the moment (in addition to Pyright 1.1.402) that makes shipping those bits risky as well.
-
Tweak the
latest-releasemetadata file to target Pyright 1.1.402 ---- Same affect as the alternative workaround above, but riskier since it forces allpyright-pythonusers into a setup where they see differences in behavior.
Hi @debonte
Sorry I got your query in the NZ weekend after a frustrating Friday ;-) Responding now, noting your plan above.
PYRIGHT_PYTHON_PYLANCE_VERSION=latest-release was the source of the most frustrating issues
I hit this error when running my local command line and in CI with the PYRIGHT_PYTHON_PYLANCE_VERSION=latest-release env var set. The reason I do this is to have my IDE errors & CI errors in sync.
The end result was that the lint step of my CI test runs were all failing.
Cursor running old pylance release ~Does ms-python.vscode-pylance have weird version numbers?~
I also get the error in the IDE but only if I open the _type_checker_internals.pyi file, which demonstrates that the broken pyright release is broken.
These are the details of my Pylance install, on Cursor rather than VS Code
Identifier ms-python.vscode-pylance
Version 2024.8.1
Last Updated 2025-02-20, 09:51:58
I note that that the server you mention is different from the one you mention, although I am on auto-updates and manually checked for later releases this morning. I am seeing the error introduced by 1.1.401 so it suggests that I'm using the correct version with a different label.
Edit: Seems this is a known version with Cursor - https://forum.cursor.com/t/python-extension-does-not-update/76119/4 - just adds another layer of complexity to this issue 🤪
OK don't rush 1.1.402, but how did 1.1.401 make it through?
I can live with the timeline you propose by disabling reportUnnecessaryTypeIgnoreComment.
However, while it might be irresponsible to upgrade people to Pyright 1.1.402, is it worth digging into 1.1.401 made it out with an error that make the system broken for anyone with reportUnnecessaryTypeIgnoreComment enabled?
Perhaps some test matrix needs to be amended?
Pylance's license only allows usage within official builds of Visual Studio Code and other Microsoft products. The use of Pylance in Cursor is a violation of our license regardless of the version of Pylance used. We made changes last year to make it harder to use Pylance in unauthorized ways, which is why newer versions don't work in Cursor and other non-Microsoft clients.
Pyright, on the other hand, is open source and its usage is allowed in all clients.
The reason I do this is to have my IDE errors & CI errors in sync.
Note that 2024.8.1 is almost a year old. The latest version of Pylance is 2025.6.1. If you configure pyright-python with PYRIGHT_PYTHON_PYLANCE_VERSION=latest-release, you're going to be installing the version of Pyright used in the latest release of Pylance which is unlikely to be compatible (ex. identical diagnostics) with 2024.8.1.
Perhaps some test matrix needs to be amended?
Agreed. I added a unit test in Pyright to detect this class of bug in https://github.com/microsoft/pyright/pull/10595.
Cool, cheers for the unit test! Hobbling Cursor through Pylance's license restrictions is probably beyond the scope of this ticket.
This issue has been fixed in prerelease version 2025.6.100, which we've just released. You can find the changelog here: CHANGELOG.md
How do you install the pre-release version, I tried selecting install specific version but .100 isn't in the list?
For others, I had to restart VS code for it to present the option to install the new version, seems it must cache versions.
Once I did that I got the option:
Are y'all still planning to release the fix to latest today?
Are y'all still planning to release the fix to latest today?
Yes. We'll update this issue when that happens.
We've pushed Pyright 1.1.402 into a hotfix (2025.6.2) for Pylance. The stable version of Pylance should have this fix in it now too.