Skip to content
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

Make use of cache while transform builtin containers #733

Merged

Conversation

stanislavlevin
Copy link
Contributor

@stanislavlevin stanislavlevin commented Dec 22, 2019

Description

As of now, the transformation of builtin containers which
members, in turn, are containers relies on safe_infer
helper. safe_infer tries to infer the node to get its
values. Doing this without a cache containing a previously
inferred nodes lead to infinite recursion, for example, on
resolving a class attribute.

Type of Changes

Type
🐛 Bug fix

Related Issue

Closes pylint-dev/pylint#3245

@stanislavlevin stanislavlevin force-pushed the builtin_container_recursion branch from d2f6469 to 4a4c734 Compare December 23, 2019 07:45
As of now, the transformation of builtin containers which
members, in turn, are containers relies on `safe_infer`
helper. `safe_infer` tries to infer the node to get its
values. Doing this without a cache containing a previously
inferred nodes lead to infinite recursion, for example, on
resolving a class attribute.

Note: this doesn't help to infer a class attribute by itself
is such a case, but prevents crash.

Closes: pylint-dev/pylint#3245
Signed-off-by: Stanislav Levin <slev@altlinux.org>
@stanislavlevin stanislavlevin force-pushed the builtin_container_recursion branch from 4a4c734 to 01a0a7a Compare December 23, 2019 08:21
@PCManticore PCManticore merged commit c54af82 into pylint-dev:master Dec 23, 2019
@PCManticore
Copy link
Contributor

Thank you for the great PR @stanislavlevin !

@couteau
Copy link

couteau commented Jul 11, 2022

This problem or a related problem still exists with pylint 2.14 and astroid 2.11 with qgis. It can be simply reproduced in a conda environment with qgis and installed and qgis added to the extension-pkg-allow-list in pylintrc, with a one line test.py file:

from qgis.gui import QgisInterface

In on macOS Monterey, with Python 3.9. Crash report attached.

pylint-crash-2022-07-11-16.txt

@DanielNoord
Copy link
Collaborator

This seems like another issue. Do you use any qgis plugins for pylint?

@couteau
Copy link

couteau commented Jul 12, 2022

I don't know of any qgis plugin for pylint. I will open a new issue for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not just another 'maximum recursion depth exceeded while calling a Python object'
4 participants