-
-
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
Crash on all conan recipe (pylint 2.14.0) #6908
Comments
This error goes away either by removing |
I don't know the |
The plugin is quite simple and maintained in https://github.com/conan-io/conan/blob/develop/conans/pylint_plugin.py Considering the same version of the plugin works with all versions of pylint before 2.14.0, you probably have a pointer to what could be the cause of the problem? |
It seems as if the |
it seems related to #6221 (crash occurs on this line https://github.com/PyCQA/pylint/pull/5544/files#diff-9b76776694be02a09ca25a56adee0b3087ad5b86dfafd318923c4bf008c131c3R1036) |
Well, that bug was indeed caused by an incorrect transform, which was fixed in pylint-dev/astroid#1505. It can't really be related to this issue, although a similar problem might occur on the plugin or in its interaction with other |
I am very sorry to ask for this, but I failed to find some examples. The plugin which triggers this crash basically does this:
The intent is to declare a dynamic field named |
@ericLemanissier The following fixes the crash: diff --git a/conans/pylint_plugin.py b/conans/pylint_plugin.py
index 892a51850..4e87c2855 100644
--- a/conans/pylint_plugin.py
+++ b/conans/pylint_plugin.py
@@ -39,7 +39,7 @@ def transform_conanfile(node):
}
for f, t in dynamic_fields.items():
- node.locals[f] = [t]
+ node.locals[f] = [i for i in t]
MANAGER.register_transform( I'm not sure if this will work for all transforms but in the case of I'm going to close this as downstream issue. If you need any help applying the patch to the |
Bug description
When parsing the following file:
pylint crashed with a
AstroidError
and with the following stacktrace:.
Command used
pylint --output-format=json --enable=all --reports=no --disable=no-absolute-import --persistent=no --init-hook="import sys;sys.path.extend(['recipes/libglvnd/all',])" --load-plugins=conans.pylint_plugin recipes/libglvnd/all/conanfile.py
Pylint output
Expected behavior
no error
Pylint version
OS / Environment
linux
Additional dependencies
bottle==0.12.21
certifi==2022.5.18.1
charset-normalizer==2.0.12
colorama==0.4.4
conan==1.49.0
distro==1.6.0
fasteners==0.17.3
idna==3.3
Jinja2==3.1.2
MarkupSafe==2.1.1
node-semver==0.6.1
patch-ng==1.17.4
pluginbase==1.0.1
Pygments==2.12.0
PyJWT==2.4.0
python-dateutil==2.8.2
PyYAML==6.0
requests==2.27.1
six==1.16.0
tqdm==4.64.0
urllib3==1.26.9
The text was updated successfully, but these errors were encountered: