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

Flake8 error B036 reported by updated flake8-bugbear version #1941

Closed
jayaddison opened this issue Feb 26, 2024 · 1 comment
Closed

Flake8 error B036 reported by updated flake8-bugbear version #1941

jayaddison opened this issue Feb 26, 2024 · 1 comment

Comments

@jayaddison
Copy link

Recent versions of flake8-bugbear have added an error class of B036:

B036: Found except BaseException: without re-raising (no raise in the top-level of the except block). This catches all kinds of things (Exception, SystemExit, KeyboardInterrupt...) and may prevent a program from exiting as expected.

This currently flags two exception handlers in the jinja codebase.

The issue is replicable from commit 3fd91e4 with flake8==7.0.0 and flake8-bugbear==24.2.6 by running flake8 src tests from the commandline:

$ flake8 src tests
src/jinja2/debug.py:146:5: B036 Don't except `BaseException` unless you plan to re-raise it.
tests/test_loader.py:258:9: B036 Don't except `BaseException` unless you plan to re-raise it.
$ echo $?
1

Linting with flake8, as used during continuous integration via GitHub Actions, is expected to encounter no errors on the codebase and exit with code zero.

Environment:

  • Python version: 3.11.8
  • Jinja version: 3.2.0.dev0 (3fd91e4)
@jayaddison
Copy link
Author

flake8-bugbear has been removed from the pre-commit lint checks (ref: #1968), and as a result this can be closed (wontfix).

@jayaddison jayaddison closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
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.

1 participant