mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-47061: deprecate cgi and cgitb (GH-32410)
Part of PEP 594.
This commit is contained in:
parent
1c8b3b5d66
commit
cd29bd13ef
8 changed files with 28 additions and 7 deletions
|
@ -570,14 +570,19 @@ print("Hello World")
|
|||
|
||||
cgi_file2 = """\
|
||||
#!%s
|
||||
import cgi
|
||||
import os
|
||||
import sys
|
||||
import urllib.parse
|
||||
|
||||
print("Content-type: text/html")
|
||||
print()
|
||||
|
||||
form = cgi.FieldStorage()
|
||||
print("%%s, %%s, %%s" %% (form.getfirst("spam"), form.getfirst("eggs"),
|
||||
form.getfirst("bacon")))
|
||||
content_length = int(os.environ["CONTENT_LENGTH"])
|
||||
query_string = sys.stdin.buffer.read(content_length)
|
||||
params = {key.decode("utf-8"): val.decode("utf-8")
|
||||
for key, val in urllib.parse.parse_qsl(query_string)}
|
||||
|
||||
print("%%s, %%s, %%s" %% (params["spam"], params["eggs"], params["bacon"]))
|
||||
"""
|
||||
|
||||
cgi_file4 = """\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue