-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ModuleNotFound error with pylint-django plugin #7938
Comments
living180
added
the
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
label
Dec 14, 2022
Pierre-Sassoulas
added
Downstream Bug 🪲
The problem happens in a lib depending on pylint, not pylint
and removed
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
labels
Dec 14, 2022
Pierre-Sassoulas
added
Bug 🪲
and removed
Downstream Bug 🪲
The problem happens in a lib depending on pylint, not pylint
labels
Dec 14, 2022
Pierre-Sassoulas
pushed a commit
that referenced
this issue
Dec 14, 2022
Ensure that the import path is fixed up before calling ._astroid_module_checker() so that the pylint_django plugin can successfully import the Django settings module when its checkers are initialized. Closes #7938
Pierre-Sassoulas
pushed a commit
that referenced
this issue
Dec 14, 2022
Ensure that the import path is fixed up before calling ._astroid_module_checker() so that the pylint_django plugin can successfully import the Django settings module when its checkers are initialized. Closes #7938 (cherry picked from commit 491eef5) Co-authored-by: Daniel Harding <dharding@living180.net>
living180
added a commit
to living180/pylint
that referenced
this issue
Dec 15, 2022
living180
added a commit
to living180/pylint
that referenced
this issue
Dec 15, 2022
living180
added a commit
to living180/pylint
that referenced
this issue
Dec 15, 2022
living180
added a commit
to living180/pylint
that referenced
this issue
Dec 15, 2022
DanielNoord
pushed a commit
that referenced
this issue
Dec 15, 2022
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug description
Starting with pylint 2.15, running pylint on a Django project with the
pylint_django
plugin enabled results in aModuleNotFound
exception. Bisecting points to commit a2c57ec as the one that exposes the issue. The reason the exception occurs is that when_astroid_module_checker()
opens the thepylint_django
plugin,pylint_django
attempts to import the Django settings module. However, the import path has not been fixed up at this point, so the module cannot be found, thus the exception. I already have a fix working on my machine and thus hope to have a PR ready shortly.Configuration
Command used
Pylint output
Expected behavior
Normal output without crashing, e.g.
Pylint version
OS / Environment
Ubuntu 20.04.05
Additional dependencies
pylint-django==2.5.3
The text was updated successfully, but these errors were encountered: