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

Error in latest version of flake8-bugbear 24.1.15 #449

Closed
adventurousAyan opened this issue Jan 16, 2024 · 4 comments · Fixed by #450
Closed

Error in latest version of flake8-bugbear 24.1.15 #449

adventurousAyan opened this issue Jan 16, 2024 · 4 comments · Fixed by #450

Comments

@adventurousAyan
Copy link

Getting error with latest version of flake8-bugbear

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/local/lib/python3.10/site-packages/flake8/checker.py", line 83, in _mp_run
    ).run_checks()
  File "/usr/local/lib/python3.10/site-packages/flake8/checker.py", line 526, in run_checks
    self.run_ast_checks()
  File "/usr/local/lib/python3.10/site-packages/flake8/checker.py", line 428, in run_ast_checks
    for line_number, offset, text, _ in runner:
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 80, in run
    visitor.visit(self.tree)
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 419, in visit
    super().visit(node)
  File "/usr/local/lib/python3.10/ast.py", line 418, in visit
    return visitor(node)
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 510, in visit_Module
    self.generic_visit(node)
  File "/usr/local/lib/python3.10/ast.py", line 426, in generic_visit
    self.visit(item)
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 419, in visit
    super().visit(node)
  File "/usr/local/lib/python3.10/ast.py", line 418, in visit
    return visitor(node)
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 575, in visit_ClassDef
    self.generic_visit(node)
  File "/usr/local/lib/python3.10/ast.py", line 426, in generic_visit
    self.visit(item)
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 419, in visit
    super().visit(node)
  File "/usr/local/lib/python3.10/ast.py", line 418, in visit
    return visitor(node)
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 569, in visit_FunctionDef
    self.generic_visit(node)
  File "/usr/local/lib/python3.10/ast.py", line 426, in generic_visit
    self.visit(item)
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 419, in visit
    super().visit(node)
  File "/usr/local/lib/python3.10/ast.py", line 418, in visit
    return visitor(node)
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 580, in visit_Try
    self.generic_visit(node)
  File "/usr/local/lib/python3.10/ast.py", line 426, in generic_visit
    self.visit(item)
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 419, in visit
    super().visit(node)
  File "/usr/local/lib/python3.10/ast.py", line 418, in visit
    return visitor(node)
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 464, in visit_ExceptHandler
    and not ExceptBaseExceptionVisitor(node).re_raised()
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 337, in re_raised
    self.visit(self.root)
  File "/usr/local/lib/python3.10/ast.py", line 418, in visit
    return visitor(node)
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 352, in visit_ExceptHandler
    return super().generic_visit(node)
  File "/usr/local/lib/python3.10/ast.py", line 426, in generic_visit
    self.visit(item)
  File "/usr/local/lib/python3.10/ast.py", line 418, in visit
    return visitor(node)
  File "/usr/local/lib/python3.10/site-packages/bugbear.py", line 344, in visit_Raise
    if node.exc is None or node.exc.id == self.root.name:
AttributeError: 'Call' object has no attribute 'id'
"""
@cooperlees
Copy link
Collaborator

Hi,

Thanks for the report. Sorry about that.

Any chance we could grab an example of the code that's causing flake8-bugbear to hit this edge case please?

Thanks

@JelleZijlstra
Copy link
Collaborator

This reproduces it:

try:
    pass
except BaseException:
    raise a.b

I'll fix it

JelleZijlstra added a commit to JelleZijlstra/flake8-bugbear that referenced this issue Jan 16, 2024
@adventurousAyan
Copy link
Author

@JelleZijlstra Any idea when the latest PR fix will be available ?

@cooperlees
Copy link
Collaborator

Released. Thanks for report and fix everyone.

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 a pull request may close this issue.

3 participants