-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace cgi
module with email.message
#11098
Conversation
After digging into a number of possibilities, I ran across a solution in the PEP 594 discussions from 2019 which point out that you an just use email.message.Message objects as an alternative. I have a working implementation with that I'll push shortly. Edit: As someone else pointed out in Discord just now, that solution also got copied directly into the PEP's text. I must be going blind. |
As of Python 3.11.0b1, the cgi module is deprecated per PEP 594 (Removing dead batteries from the standard library), and raises DeprecationWarning when imported. The only places pip relies on this are pip._internal.index.collector._get_encoding_from_headers() and pip._internal.network.download.parse_content_disposition() calling parse_headers(), so replace that with the solution recommended in an old PEP 594 thread from 2019: https://discuss.python.org/t/1704/14 Fixes: #11099
Added. If it's not obvious, I spend most of my time with other code review platforms and have to look up GitHub's conventions every time I try to use it. Thanks for the tip! |
Thanks for this effort! What's needed to merge this? |
cgi
module with email.message
or like this aio-libs/aiohttp#6708 |
As of Python 3.11.0b1, the cgi module is deprecated per PEP 594
(Removing dead batteries from the standard library), and raises
DeprecationWarning when imported. The only places pip relies on this
are pip._internal.index.collector._get_encoding_from_headers() and
pip._internal.network.download.parse_content_disposition() calling
parse_headers(), so replace that with the solution recommended in an
old PEP 594 thread from 2019: https://discuss.python.org/t/1704/14
Fixes: #11099