-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
[PC4] 3.3 dependencies trigger ImportError: cannot import name events
#1656
Comments
Any chance those having problems with it can check, they really have latest PC4.0-beta8 installed? That's a known error of older releases.
Some action were taken to manually load that module from package file directly - bypassing ST's plugin loading mechanism. I can't reproduce those imports to fail for any LSP-helper package, which uses lsp_utils since then on one of my test setups on Win/Linux. All those use latest Package Control.sublime-package in zipped form with all my over 100 packages installed for real world testing. Those include LSP and various helper packages. I can't however test anything on MacOS. To check for that issue, someone could just manipulate version number of an effected LSP-helper package while ST is closed. This triggers updater at start. As ST's |
The user in that specific issue I've linked had issue with Another user with this problem is at TerminalFi/LSP-copilot#123. As far as user's directory listing shows, the |
With the technical reason for that issue in mind, lsp_utils could work around it by not importing the module globally, but by following https://packagecontrol.io/docs/events and import it locally in GenericClientHandler.cleanup() method. This would ensure import taking place not before all packages have been loaded. |
I might do that but I feel that it would be better to address this issue first in PC4 anyway. |
It's working on Win/Linux and I don't see what changes would needed beyond already taken actions to manually load If someone with a Mac wants to investigate and fix the importer, I'd however accept a PR. A first step was to fix Libs\python33\package_control.py directly and once it's working changes would need to go into https://github.com/wbond/package_control/blob/four-point-oh/package_control/bootstrap.py Note, that this module just forwards to Packages/Package Control/package_control at this point. Anything beyond that is not planned to be moved to Libs\ at this point. So moving |
I doubt it's a Mac-specific issue because it's only an issue for some Mac users and not all. I can reproduce this issue with an old version of PC4 but not the new one. I guess we need more info from users... |
My hunch is that some users just installed beta2 as it is the version which was directly linked in some of my posts - stupid me. That's also the build, which ships with a package-metadata.json with a All those users must either manually update once again or wait for a final release. |
There are multiple reports in various repos (I can add links when I find them again) about
lsp_utils
throwing on trying to importevents
frompackage_control
module.For example here is one case: sublimelsp/LSP-ruff#38 (comment)
I saw that there was some related fix done in #1642 but it seems like some still have problems with that.
The text was updated successfully, but these errors were encountered: