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

Remove uses of warnings.catch_warnings (#2690) #2692

Merged
merged 4 commits into from
May 3, 2023

Conversation

dairiki
Copy link
Contributor

@dairiki dairiki commented May 3, 2023

This removes the use of warnings.catch_warnings, thus preventing the rest of the global warnings registry (and the ensuing repetition of warnings filtered with the "default" action) as discussed at #2690.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.
  • Question (see below): Does werkzeug.wsgi._make_chunk_iter really have to issue a deprecation warning?

Question

Since _make_chunk_iter is not document API, can the deprecation warning it emits just be deleted? Doing so would remove several cases where catch_warnings was suppressing warnings from internal calls.

@davidism davidism added this to the 2.3.4 milestone May 3, 2023
@davidism davidism changed the base branch from main to 2.3.x May 3, 2023 17:01
@davidism davidism merged commit 3a4c8d0 into pallets:2.3.x May 3, 2023
9 checks passed
@dairiki dairiki deleted the fix.2690-remove-catch_warnings branch May 3, 2023 17:06
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use of warnings.catch_warnings resets the global warnings registry
2 participants