Pylint crashes if PySide is loaded with init hook [Regression] #7616
Labels
Astroid
Related to astroid
Crash 💥
A bug that makes pylint crash
Duplicate 🐫
Duplicate of an already existing issue
Bug description
We are using the
init-hook
to load a venv, so we don't have to install pylint in all project venv and can use pre-commit hooks easier.Our last pylint version was
With the update to
pylint crahses when trying to lint a file that contains a PySide6 import, when adding PySide to
extension-pkg-allow-list
.To reproduce:
python3.10 -m venv qtenv
python3.10 -m venv pylint_env; pylint_env/bin/pip install pylint
testfile.py
Configuration
No response
Command used
./pylint_env/bin/pylint --extension-pkg-allow-list=PySide6 --init-hook 'import sys;sys.path.append("/absolute/path/to/qtenv/lib/python3.10/site-packages");sys.path.append("/absolute/path/to/qtenv/lib64/python3.10/site-packages");print(sys.path)' testfile.py
Pylint output
pylint crashed with a
AstroidError
and with the following stacktrace:Expected behavior
Pylint find the import like in the previous version used and does not crash.
Pylint version
OS / Environment
Fedora release 35 (Thirty Five)
Notes
Using
--unsafe-load-any-extension=y
and/or--disable=c-extension-no-member
won't crash but it also doesn't find the import and shows.The text was updated successfully, but these errors were encountered: