Skip to content

Extract utility functions from wsgi.py#2415

Merged
pgjones merged 1 commit into
pallets:mainfrom
rrahkola:extract_from_wsgi
Jul 22, 2022
Merged

Extract utility functions from wsgi.py#2415
pgjones merged 1 commit into
pallets:mainfrom
rrahkola:extract_from_wsgi

Conversation

@rrahkola
Copy link
Copy Markdown
Contributor

@rrahkola rrahkola commented May 3, 2022

This is a step towards supporting ASGI. Utility functions in the top-level wsgi.py module are extracted into the sansio/utils.py module.

The following functions were extracted:

  • get_content_length
  • get_query_string
  • get_path_info

The following functions were ignored:

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.

This is to make these functions available to non-WSGI uses.
@pgjones pgjones force-pushed the extract_from_wsgi branch from 81cddbe to c46ecbb Compare July 22, 2022 11:32
@pgjones pgjones merged commit 81d2ed0 into pallets:main Jul 22, 2022
@davidism davidism added this to the 2.2.0 milestone Jul 22, 2022
dairiki added a commit to dairiki/lektor that referenced this pull request Jul 24, 2022
dairiki added a commit to lektor/lektor that referenced this pull request Jul 24, 2022
* Fix for werkzeug 2.2.0

The `any` route converter has apparently stopped working correctly if one of the choices is the empty string.

* Use shift_path_info from wsgiref instead of werkzeug's pop_path_info

Pop_path_info has been deprecated. (See pallets/werkzeug#2415.)
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 6, 2022
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.

refactor WSGI assumptions out of http.py and wsgi.py functions

3 participants