mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +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
|
@ -5,6 +5,7 @@ that uses .pypirc in the distutils.command package.
|
|||
"""
|
||||
import os
|
||||
from configparser import RawConfigParser
|
||||
import warnings
|
||||
|
||||
from distutils.cmd import Command
|
||||
|
||||
|
@ -111,7 +112,9 @@ class PyPIRCCommand(Command):
|
|||
|
||||
def _read_pypi_response(self, response):
|
||||
"""Read and decode a PyPI HTTP response."""
|
||||
import cgi
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", DeprecationWarning)
|
||||
import cgi
|
||||
content_type = response.getheader('content-type', 'text/plain')
|
||||
encoding = cgi.parse_header(content_type)[1].get('charset', 'ascii')
|
||||
return response.read().decode(encoding)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue