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

Internal error on invalid print (py2) statement #744

Closed
MarcinWieczorek opened this issue Nov 24, 2022 · 2 comments · Fixed by #745
Closed

Internal error on invalid print (py2) statement #744

MarcinWieczorek opened this issue Nov 24, 2022 · 2 comments · Fixed by #745
Labels

Comments

@MarcinWieczorek
Copy link

Hi, I'd like to report a bug that occurred during using flake8. Please don't ask me about the code, I'm just analyzing data submitted by other people. Thanks!

Packages

$ pip freeze
flake8==6.0.0
flake8-json==21.7.0
mccabe==0.7.0
pycodestyle==2.10.0
pyflakes==3.0.0

code

print *= -1

Traceback

flake8.checker            MainProcess     85 INFO     Making checkers
flake8.checker            ForkPoolWorker-4  44861 CRITICAL Plugin pyflakes[F] raised an unexpected exception
Traceback (most recent call last):
  File "/venv/lib/python3.10/site-packages/flake8/checker.py", line 341, in run_check
    return plugin.obj(**arguments, **params)
  File "/venv/lib/python3.10/site-packages/flake8/plugins/pyflakes.py", line 96, in __init__
    super().__init__(tree, filename=filename, withDoctest=with_doctest)
  File "/venv/lib/python3.10/site-packages/pyflakes/checker.py", line 787, in __init__
    self.handleChildren(tree)
  File "/venv/lib/python3.10/site-packages/pyflakes/checker.py", line 1238, in handleChildren
    self.handleNode(node, tree)
  File "/venv/lib/python3.10/site-packages/pyflakes/checker.py", line 1283, in handleNode
    handler(node)
  File "/venv/lib/python3.10/site-packages/pyflakes/checker.py", line 2052, in AUGASSIGN
    self.handleNodeLoad(node.target)
  File "/venv/lib/python3.10/site-packages/pyflakes/checker.py", line 1096, in handleNodeLoad
    parent = self.getParent(node)
  File "/venv/lib/python3.10/site-packages/pyflakes/checker.py", line 941, in getParent
    node = node._pyflakes_parent
AttributeError: 'Name' object has no attribute '_pyflakes_parent'
flake8.main.application   MainProcess  44924 INFO     Finished running
flake8.main.application   MainProcess  44924 INFO     Reporting errors
flake8.main.application   MainProcess  44924 INFO     Found a total of 0 violations and reported 0
Flake8 failed.
offending_file.py: "pyflakes[F]" failed during execution due to AttributeError("'Name' object has no attribute '_pyflakes_parent'")
@asottile asottile added the bug label Nov 24, 2022
@asottile
Copy link
Member

nice! looks like this isn't a 3.x regression but has been broken for some time. very weird!

@MarcinWieczorek
Copy link
Author

Thanks

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

Successfully merging a pull request may close this issue.

2 participants