From 4e3aa1d249efcd58978be5a7745397139c18c512 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Thu, 7 Apr 2022 20:39:05 -0700 Subject: [PATCH] bpo-47061: deprecate cgi and cgitb 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 +++++++++---- .../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 bc4a1953c10c22..726d181cd71ac2 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 22897a14a9c122..8787567be7c081 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -53,6 +53,9 @@ "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 ec156843099d36..8ce0e833a989aa 100644 --- a/Lib/cgitb.py +++ b/Lib/cgitb.py @@ -31,8 +31,12 @@ 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 '''