summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Lib/cgi.py
diff options
context:
space:
mode:
authorshadchin <[email protected]>2022-04-18 12:39:32 +0300
committershadchin <[email protected]>2022-04-18 12:39:32 +0300
commitd4be68e361f4258cf0848fc70018dfe37a2acc24 (patch)
tree153e294cd97ac8b5d7a989612704a0c1f58e8ad4 /contrib/tools/python3/src/Lib/cgi.py
parent260c02f5ccf242d9d9b8a873afaf6588c00237d6 (diff)
IGNIETFERRO-1816 Update Python 3 from 3.9.12 to 3.10.4
ref:9f96be6d02ee8044fdd6f124b799b270c20ce641
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)