|
38 | 38 | import urllib.parse |
39 | 39 | from email.parser import FeedParser |
40 | 40 | from email.message import Message |
41 | | -from warnings import warn |
42 | 41 | import html |
43 | 42 | import locale |
44 | 43 | import tempfile |
45 | 44 |
|
46 | | -__all__ = ["MiniFieldStorage", "FieldStorage", |
47 | | - "parse", "parse_qs", "parse_qsl", "parse_multipart", |
| 45 | +__all__ = ["MiniFieldStorage", "FieldStorage", "parse", "parse_multipart", |
48 | 46 | "parse_header", "test", "print_exception", "print_environ", |
49 | 47 | "print_form", "print_directory", "print_arguments", |
50 | | - "print_environ_usage", "escape"] |
| 48 | + "print_environ_usage"] |
51 | 49 |
|
52 | 50 | # Logging support |
53 | 51 | # =============== |
@@ -183,21 +181,6 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0): |
183 | 181 | encoding=encoding) |
184 | 182 |
|
185 | 183 |
|
186 | | -# parse query string function called from urlparse, |
187 | | -# this is done in order to maintain backward compatibility. |
188 | | - |
189 | | -def parse_qs(qs, keep_blank_values=0, strict_parsing=0): |
190 | | - """Parse a query given as a string argument.""" |
191 | | - warn("cgi.parse_qs is deprecated, use urllib.parse.parse_qs instead", |
192 | | - DeprecationWarning, 2) |
193 | | - return urllib.parse.parse_qs(qs, keep_blank_values, strict_parsing) |
194 | | - |
195 | | -def parse_qsl(qs, keep_blank_values=0, strict_parsing=0): |
196 | | - """Parse a query given as a string argument.""" |
197 | | - warn("cgi.parse_qsl is deprecated, use urllib.parse.parse_qsl instead", |
198 | | - DeprecationWarning, 2) |
199 | | - return urllib.parse.parse_qsl(qs, keep_blank_values, strict_parsing) |
200 | | - |
201 | 184 | def parse_multipart(fp, pdict, encoding="utf-8", errors="replace"): |
202 | 185 | """Parse multipart input. |
203 | 186 |
|
@@ -974,18 +957,6 @@ def print_environ_usage(): |
974 | 957 | # Utilities |
975 | 958 | # ========= |
976 | 959 |
|
977 | | -def escape(s, quote=None): |
978 | | - """Deprecated API.""" |
979 | | - warn("cgi.escape is deprecated, use html.escape instead", |
980 | | - DeprecationWarning, stacklevel=2) |
981 | | - s = s.replace("&", "&") # Must be done first! |
982 | | - s = s.replace("<", "<") |
983 | | - s = s.replace(">", ">") |
984 | | - if quote: |
985 | | - s = s.replace('"', """) |
986 | | - return s |
987 | | - |
988 | | - |
989 | 960 | def valid_boundary(s): |
990 | 961 | import re |
991 | 962 | if isinstance(s, bytes): |
|
0 commit comments