diff options
author | INADA Naoki <methane@users.noreply.github.com> | 2018-06-19 08:28:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-19 08:28:50 (GMT) |
commit | 698865dcbb302ae742b76be883822f1563764ff9 (patch) | |
tree | 28064c6e361c4e7af8e4ef3db85c82f64e3dbd67 /Lib/cgi.py | |
parent | cb970730e3ca2522e9b1700dcaf0a06b7e898db6 (diff) | |
download | cpython-698865dcbb302ae742b76be883822f1563764ff9.zip cpython-698865dcbb302ae742b76be883822f1563764ff9.tar.gz cpython-698865dcbb302ae742b76be883822f1563764ff9.tar.bz2 |
bpo-33843: Remove deprecated stuff in cgi module (GH-7662)
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-x | Lib/cgi.py | 33 |
1 files changed, 2 insertions, 31 deletions
@@ -38,16 +38,14 @@ import os import urllib.parse from email.parser import FeedParser from email.message import Message -from warnings import warn import html import locale import tempfile -__all__ = ["MiniFieldStorage", "FieldStorage", - "parse", "parse_qs", "parse_qsl", "parse_multipart", +__all__ = ["MiniFieldStorage", "FieldStorage", "parse", "parse_multipart", "parse_header", "test", "print_exception", "print_environ", "print_form", "print_directory", "print_arguments", - "print_environ_usage", "escape"] + "print_environ_usage"] # Logging support # =============== @@ -183,21 +181,6 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0): encoding=encoding) -# parse query string function called from urlparse, -# this is done in order to maintain backward compatibility. - -def parse_qs(qs, keep_blank_values=0, strict_parsing=0): - """Parse a query given as a string argument.""" - warn("cgi.parse_qs is deprecated, use urllib.parse.parse_qs instead", - DeprecationWarning, 2) - return urllib.parse.parse_qs(qs, keep_blank_values, strict_parsing) - -def parse_qsl(qs, keep_blank_values=0, strict_parsing=0): - """Parse a query given as a string argument.""" - warn("cgi.parse_qsl is deprecated, use urllib.parse.parse_qsl instead", - DeprecationWarning, 2) - return urllib.parse.parse_qsl(qs, keep_blank_values, strict_parsing) - def parse_multipart(fp, pdict, encoding="utf-8", errors="replace"): """Parse multipart input. @@ -974,18 +957,6 @@ environment as well. Here are some common variable names: # Utilities # ========= -def escape(s, quote=None): - """Deprecated API.""" - warn("cgi.escape is deprecated, use html.escape instead", - DeprecationWarning, stacklevel=2) - s = s.replace("&", "&") # Must be done first! - s = s.replace("<", "<") - s = s.replace(">", ">") - if quote: - s = s.replace('"', """) - return s - - def valid_boundary(s): import re if isinstance(s, bytes): |