PEP 594: mention how to replace (Mini)FieldStorage (#2306)

This commit is contained in:
Colin Watson 2022-02-08 00:50:09 +00:00 committed by GitHub
parent c3baa73263
commit ddeb1d867f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -338,7 +338,11 @@ related to executing code are:
- ``parse`` with ``urllib.parse.parse_qs`` (``parse`` is just a wrapper)
- ``parse_header`` with ``email.message.Message`` (see example below)
- ``parse_multipart`` with ``email.message.Message`` (same MIME RFCs)
- ``FieldStorage``/``MiniFieldStorage`` has no direct replacement
- ``FieldStorage``/``MiniFieldStorage`` has no direct replacement, but can
typically be replaced by using `multipart
<https://pypi.org/project/multipart/>`_ (for ``POST`` and ``PUT``
requests) or ``urllib.parse.parse_qsl`` (for ``GET`` and ``HEAD``
requests)
- ``valid_boundary`` (undocumented) with ``re.compile("^[ -~]{0,200}[!-~]$")``
As an explicit example of how close ``parse_header`` and