summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Lib/cgi.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tools/python3/src/Lib/cgi.py')
-rwxr-xr-xcontrib/tools/python3/src/Lib/cgi.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/tools/python3/src/Lib/cgi.py b/contrib/tools/python3/src/Lib/cgi.py
index 1e880e51848..6cb8cf28bd6 100755
--- a/contrib/tools/python3/src/Lib/cgi.py
+++ b/contrib/tools/python3/src/Lib/cgi.py
@@ -41,6 +41,7 @@ from email.message import Message
import html
import locale
import tempfile
+import warnings
__all__ = ["MiniFieldStorage", "FieldStorage", "parse", "parse_multipart",
"parse_header", "test", "print_exception", "print_environ",
@@ -77,9 +78,11 @@ def initlog(*allargs):
"""
global log, logfile, logfp
+ warnings.warn("cgi.log() is deprecated as of 3.10. Use logging instead",
+ DeprecationWarning, stacklevel=2)
if logfile and not logfp:
try:
- logfp = open(logfile, "a")
+ logfp = open(logfile, "a", encoding="locale")
except OSError:
pass
if not logfp:
@@ -198,7 +201,7 @@ def parse_multipart(fp, pdict, encoding="utf-8", errors="replace", separator='&'
value is a list of values for that field. For non-file fields, the value
is a list of strings.
"""
- # RFC 2026, Section 5.1 : The "multipart" boundary delimiters are always
+ # RFC 2046, Section 5.1 : The "multipart" boundary delimiters are always
# represented as 7bit US-ASCII.
boundary = pdict['boundary'].decode('ascii')
ctype = "multipart/form-data; boundary={}".format(boundary)