Open
Description
Description
When running pylint with the pylint-django plugin enabled, pylint crashes with a fatal error. This appears to be related to compatibility issues between the current version of pylint (3.3.7), dill (0.4.0), and Python 3.13.1.
Environment
- Python version: 3.13.1
- pylint version: 3.3.7
- astroid version: 3.3.10
- dill version: 0.4.0
- Operating system: macOS
Steps to Reproduce
- Install the dependencies:
pip install pylint==3.3.7 pylint-django
- Create a .pylintrc file with
load-plugins=pylint_django
- Run pylint on a Python file
- Observe the fatal error
Expected Behavior
pylint should analyze the file without crashing
Actual Behavior
Infinite recursion in wrap_func and ignore_import_warnings_for_related_fields functions leading to:
RecursionError: maximum recursion depth exceeded
Traceback Summary
pylint-crash-2025-05-16-12-38-18.txt
`
Command used
pylint a.py
Pylint output
pylint crashed with a ``AstroidError`` and with the following stacktrace:
Traceback (most recent call last):
File "~//.vscode/extensions/ms-python.pylint-2025.2.0/bundled/libs/pylint/lint/pylinter.py", line 788, in _lint_file
check_astroid_module(module)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "~//.vscode/extensions/ms-python.pylint-2025.2.0/bundled/libs/pylint/lint/pylinter.py", line 1020, in check_astroid_module
retval = self._check_astroid_module(
ast_node, walker, rawcheckers, tokencheckers
)
File "~//.vscode/extensions/ms-python.pylint-2025.2.0/bundled/libs/pylint/lint/pylinter.py", line 1072, in _check_astroid_module
walker.walk(node)
~~~~~~~~~~~^^^^^^
File "~//.vscode/extensions/ms-python.pylint-2025.2.0/bundled/libs/pylint/utils/ast_walker.py", line 92, in walk
callback(astroid)
~~~~~~~~^^^^^^^^^
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 766, in wrap_func
def allow_meta_protected_access(node):
^^^^^^^^^^^^^^^^^^^^^^^
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 339, in ignore_import_warnings_for_related_fields
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 766, in wrap_func
def allow_meta_protected_access(node):
<---------- 2000 lines later ----------->
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 339, in ignore_import_warnings_for_related_fields
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 766, in wrap_func
def allow_meta_protected_access(node):
^^^^^^^^^^^^^^^^^^^^^^^
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 339, in ignore_import_warnings_for_related_fields
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 766, in wrap_func
def allow_meta_protected_access(node):
^^^^^^^^^^^^^^^^^^^^^^^
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 339, in ignore_import_warnings_for_related_fields
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 766, in wrap_func
def allow_meta_protected_access(node):
^^^^^^^^^^^^^^^^^^^^^^^
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 339, in ignore_import_warnings_for_related_fields
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 766, in wrap_func
def allow_meta_protected_access(node):
^^^^^^^^^^^^^^^^^^^^^^^
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 339, in ignore_import_warnings_for_related_fields
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 766, in wrap_func
def allow_meta_protected_access(node):
^^^^^^^^^^^^^^^^^^^^^^^
File "~//Projects/aiFeeder_FRESH/00_backend/django-container/.venv/lib/python3.13/site-packages/pylint_django/augmentations/__init__.py", line 320, in ignore_import_warnings_for_related_fields
prevent unused-import warnings which are caused by the ForeignKey
^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "~//.vscode/extensions/ms-python.pylint-2025.2.0/bundled/libs/pylint/lint/pylinter.py", line 752, in _lint_files
self._lint_file(fileitem, module, check_astroid_module)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~//.vscode/extensions/ms-python.pylint-2025.2.0/bundled/libs/pylint/lint/pylinter.py", line 790, in _lint_file
raise astroid.AstroidError from e
astroid.exceptions.AstroidError
`
Additional Information
This appears similar to previously reported issues:
- Pylint fails on Python 3.11 due to issue in 'dill' package pywbem/pywbem#2948 (fixed by upgrading to dill 0.3.6)
- KeyError while running pylint with parallel job option using dill-0.3.5 uqfoundation/dill#478
- Upgrading from pylint
2.14.5
to2.15.0
causesdjango.core.exceptions.ImproperlyConfigured
to be raised #370
Temporary Workaround
I've found that commenting out load-plugins=pylint_django
in .pylintrc allows pylint to run without crashing.
Metadata
Metadata
Assignees
Labels
No labels