summaryrefslogtreecommitdiffstats
path: root/Lib/cgi.py
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2021-04-29 02:36:04 (GMT)
committerGitHub <noreply@github.com>2021-04-29 02:36:04 (GMT)
commite52ab42cedd2a5ef4c3c1a47d0cf96a8f06d051f (patch)
tree6c10f217b202ed648c88eb2d23eeb4ba3088eb64 /Lib/cgi.py
parenta69256527f93d2aa32e76658deab829e324d97b6 (diff)
downloadcpython-e52ab42cedd2a5ef4c3c1a47d0cf96a8f06d051f.zip
cpython-e52ab42cedd2a5ef4c3c1a47d0cf96a8f06d051f.tar.gz
cpython-e52ab42cedd2a5ef4c3c1a47d0cf96a8f06d051f.tar.bz2
bpo-41139: Deprecate `cgi.log()` (GH-25625)
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-xLib/cgi.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py
index 6c72507..6cb8cf2 100755
--- a/Lib/cgi.py
+++ b/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: