🔧 Stop using the cgi
stdlib module
#2021
Open
+47
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
the module was deprecatied in py 3.11 and removed in py 3.13 there are examples of using the email module to resolve this: PEP 594
python-babel/babel#873
https://stackoverflow.com/questions/69068527/python-3-cgi-parse-header
This method doesn't seem to work for cherrypy.
The email.message module is trying to create a higher level object that is intelligent about the headers it has defined. The cgi.parse_header function is a very low level unintelligent function that simply parses header content based on structure and does not inspect the contents. Because of the intelligence of the email.message object cherrypy can't use it in the very generic way that the cgi.parse_header function was being used.
Fix #2014
What kind of change does this PR introduce?
What is the related issue number (starting with
#
)#2014
What is the current behavior? (You can also link to an open issue here)
Deprecation warnings in 3.11 & and 3.12
Module import error in 3.13
#2014
What is the new behavior (if this is a feature change)?
Other information:
Checklist:
and description in grammatically correct, complete sentences