Skip to content

deprecate more #2085

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

Merged
merged 7 commits into from
Apr 16, 2021
Merged

deprecate more #2085

merged 7 commits into from
Apr 16, 2021

Conversation

davidism
Copy link
Member

Deprecate various things I came across while adding typing to the code. These either seem unused or caused issues with typing, or both.

  • urls.Href seems to have been replaced by werkzeug.routing.
  • utils.detect_utf_encoding was probably used by Flask, so I'm issuing a deprecation warning just in case someone uses an older Flask with Werkzeug 2.0. This function is part of Python's json.loads now.
  • CombinedMultiDict and Headers both had a has_key alias for __contains__. has_key has been deprecated since Python 2.
  • Request.disable_data_descriptor class attribute. There's an old comment about deprecating the request.data attribute, but I don't think that should be done. shallow=True can be used to the same effect.
  • There's an (internal) helper called cache_property, renamed it cache_control_property to avoid confusion with cached_property, especially when using IDEs to find names.
  • url_decode_stream had a return_iterator flag that was unused anywhere in the code.
  • HTTPException.wrap seems to only be used to create the BadRequestKeyError class. It's more straightforward to create the class manually, and the type system understands it better too.

One that I did not remove was the parse_option_header multiple parameter. It's not used anywhere, but it's the majority of the function, and I think it could be refactored differently later.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@davidism davidism added this to the 2.0.0 milestone Apr 16, 2021
@davidism davidism merged commit 38d859b into master Apr 16, 2021
@davidism davidism deleted the more-deprecation branch April 16, 2021 05:46
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2021
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.

1 participant