mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
bpo-41139: Deprecate cgi.log()
(GH-25625)
This commit is contained in:
parent
a69256527f
commit
e52ab42ced
4 changed files with 10 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue