From cd29bd13ef1fe18970c5d43b66c545dd03117cb9 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 8 Apr 2022 17:15:35 -0700 Subject: bpo-47061: deprecate cgi and cgitb (GH-32410) Part of PEP 594. --- Doc/whatsnew/3.11.rst | 2 ++ Lib/cgi.py | 3 +++ Lib/cgitb.py | 4 ++++ Lib/distutils/config.py | 5 ++++- Lib/test/test_cgi.py | 4 +++- Lib/test/test_cgitb.py | 3 ++- Lib/test/test_httpservers.py | 13 +++++++++---- .../next/Library/2022-04-07-20-32-47.bpo-47061.TOufgh.rst | 1 + 8 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2022-04-07-20-32-47.bpo-47061.TOufgh.rst diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 2da01d8..2758a26 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -834,6 +834,8 @@ Deprecated * :mod:`aifc` * :mod:`audioop` + * :mod:`cgi` + * :mod:`cgitb` (Contributed by Brett Cannon in :issue:`47061`.) diff --git a/Lib/cgi.py b/Lib/cgi.py index 22897a1..8787567 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -53,6 +53,9 @@ __all__ = ["MiniFieldStorage", "FieldStorage", "parse", "parse_multipart", "print_form", "print_directory", "print_arguments", "print_environ_usage"] + +warnings._deprecated(__name__, remove=(3,13)) + # Logging support # =============== diff --git a/Lib/cgitb.py b/Lib/cgitb.py index ec15684..8ce0e83 100644 --- a/Lib/cgitb.py +++ b/Lib/cgitb.py @@ -31,8 +31,12 @@ import tempfile import time import tokenize import traceback +import warnings from html import escape as html_escape +warnings._deprecated(__name__, remove=(3, 13)) + + def reset(): """Return a string that resets the CGI and browser to a known state.""" return '''