Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

cgi.parse_header() is deprecated in Python 3.11+ #109

Open
cbrews opened this issue Jan 22, 2023 · 0 comments
Open

cgi.parse_header() is deprecated in Python 3.11+ #109

cbrews opened this issue Jan 22, 2023 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@cbrews
Copy link
Owner

cbrews commented Jan 22, 2023

We are using the cgi module to parse mime type in response.py. This is deprecated in Python 3.11 and will be removed in Python 3.13.

_, options = cgi.parse_header(meta)

Replace this usage with email module as defined in the specs:

from email.message import EmailMessage
msg = EmailMessage()
msg['content-type'] = 'application/json; charset="utf8"'
main, params = msg.get_content_type(), msg['content-type'].params

TODO: determine if this is backwards compatible to 3.7 or if we need conditional handling here.

@cbrews cbrews added bug Something isn't working good first issue Good for newcomers labels Jan 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant