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

Fix crash on Super.getattr for previously uninferable attributes #1370

Merged
merged 4 commits into from
Jan 26, 2022

Conversation

DanielNoord
Copy link
Collaborator

Steps

  • For new features or bug fixes, add a ChangeLog entry describing what your PR does.
  • Write a good description on what the PR does.

Description

Will close when merged: #pylint-dev/pylint#5679

Pretty difficult to replicate this, but whenever the result of the inference was Uninferable we did not add that to the cache. Instead we added [] to the cache as this is how results is initialised. On a next try of inference of that node we see that the node is in the cache and yield from the empty list instead of yielding Uninferable. This seems only relevant whenever we get more than 100+ inference tries for a single node, which I think was happening with the sqlalchemy node.

Type of Changes

Type
🐛 Bug fix

Related Issue

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good already !

ChangeLog Outdated Show resolved Hide resolved
tests/unittest_regrtest.py Show resolved Hide resolved
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

ChangeLog Outdated Show resolved Hide resolved
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
@Pierre-Sassoulas Pierre-Sassoulas merged commit 7471086 into pylint-dev:main Jan 26, 2022
@DanielNoord DanielNoord deleted the crash-super-getattr branch January 26, 2022 19:04
@drothlis
Copy link

This also fixes pylint no-member false positives: no-member doesn't warn if the owner is Uninferable, but because of this bug the Uninferable value was missing from infer().

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.

3 participants