@@ -118,6 +118,36 @@ Removed
118
118
* Remove support for using :class: `pathlib.Path ` objects as context managers.
119
119
This functionality was deprecated and made a no-op in Python 3.9.
120
120
121
+ * :pep: `594 `: Remove the :mod: `!cgi` ` and :mod: `!cgitb ` modules,
122
+ deprecated in Python 3.11.
123
+
124
+ * ``cgi.FieldStorage `` can typically be replaced with
125
+ :func: `urllib.parse.parse_qsl ` for ``GET `` and ``HEAD `` requests, and the
126
+ :mod: `email.message ` module or `multipart
127
+ <https://pypi.org/project/multipart/> `__ PyPI project for ``POST `` and
128
+ ``PUT ``.
129
+
130
+ * ``cgi.parse() `` can be replaced by calling :func: `urllib.parse.parse_qs `
131
+ directly on the desired query string, except for ``multipart/form-data ``
132
+ input, which can be handled as described for ``cgi.parse_multipart() ``.
133
+
134
+ * ``cgi.parse_multipart() `` can be replaced with the functionality in the
135
+ :mod: `email ` package (e.g. :class: `email.message.EmailMessage ` and
136
+ :class: `email.message.Message `) which implements the same MIME RFCs, or
137
+ with the `multipart <https://pypi.org/project/multipart/ >`__ PyPI project.
138
+
139
+ * ``cgi.parse_header() `` can be replaced with the functionality in the
140
+ :mod: `email ` package, which implements the same MIME RFCs. For example,
141
+ with :class: `email.message.EmailMessage `::
142
+
143
+ from email.message import EmailMessage
144
+ msg = EmailMessage()
145
+ msg['content-type'] = 'application/json; charset="utf8"'
146
+ main, params = msg.get_content_type(), msg['content-type'].params
147
+
148
+ (Contributed by Victor Stinner in :gh: `104773 `.)
149
+
150
+
121
151
Porting to Python 3.13
122
152
======================
123
153
0 commit comments