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

AttributeError: 'Subscript' object has no attribute 'name' #2

Closed
hugovk opened this issue Mar 1, 2022 · 2 comments
Closed

AttributeError: 'Subscript' object has no attribute 'name' #2

hugovk opened this issue Mar 1, 2022 · 2 comments

Comments

@hugovk
Copy link

hugovk commented Mar 1, 2022

I think this belongs here, but please let me know if it should go to pylint instead.

Python 3.10.2
macOS Monterey
pylint==2.12.2
perflint==0.0.9

$ git clone https://github.com/python-pillow/Pillow
...
$ cd Pillow
$ pylint src/PIL/PngImagePlugin.py
...

-----------------------------------
Your code has been rated at 6.99/10

$ pylint src/PIL/PngImagePlugin.py  --load-plugins=perflint
...
Exception on node <Subscript l.1136 at 0x104ca3bb0> in file '/private/tmp/Pillow/src/PIL/PngImagePlugin.py'
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pylint/utils/ast_walker.py", line 72, in walk
    callback(astroid)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/perflint/for_loop_checker.py", line 248, in visit_subscript
    inferred_value = local_type(node.value)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/perflint/for_loop_checker.py", line 19, in local_type
    if name.name in name.frame().locals:
AttributeError: 'Subscript' object has no attribute 'name'
src/PIL/PngImagePlugin.py:1:0: F0001: Fatal error while checking 'src/PIL/PngImagePlugin.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/Users/huvankem/Library/Caches/pylint/pylint-crash-2022-03-01-17.txt'. (fatal)

------------------------------------------------------------------
Your code has been rated at 6.02/10 (previous run: 6.99/10, -0.97)

Here's the crash file:

pylint-crash-2022-03-01-17.txt

@tonybaloney
Copy link
Owner

I fixed that in 0.1.0. thanks for the report.

lmk if the update doesn't work

@hugovk
Copy link
Author

hugovk commented Mar 2, 2022

Thanks, confirmed fixed!

@hugovk hugovk closed this as completed Mar 2, 2022
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

No branches or pull requests

2 participants