-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-109096: Deprecate http.server.CGIHTTPRequestHandler
#109387
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
Conversation
Since the cgi module was removed in Python 3.13, it makes sense to deprecate CGIHTTPRequestHandler. wsgiref has BaseCGIHandler, CGIHandler and IISCGIHandler classes. Are they still relevant nowadays? WSGI isn't suppose to replace CGI? wsgiref.simple_ref uses |
WSGI used much of the original CGI web server to application interfaces to make migrating from old CGI scripts child processes to in-server-process WSGI calls easy. https://peps.python.org/pep-3333/#specification-details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of wording suggestions. Deprecating CGI sounds like a good idea
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please document the deprecation at https://docs.python.org/dev/whatsnew/3.13.html#deprecated and the future removal at https://docs.python.org/dev/whatsnew/3.13.html#pending-removal-in-python-3-15 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I dislike the _self hack in the test but it's not a big deal.
Agreed. If it weren't in test code set to be deleted in two years I'd have refactored further. |
|
|
|
…n#109387) Deprecate `http.server.CGIHTTPRequestHandler`. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Only just came across this. As a teacher of Python, where I usually only have access to core Python (no internet access), I have found the |
You can provide Python with a old (non deprecated) copy of CGIHTTPRequestHandler to your students. |
Yes, that would work. But often I can't bring any external code in either; they've got core Python and that's all I can work with. |
So far I haven't found any practical users of this 1990s era functionality. Given we don't encourage the use of
http.server
as anyones main serving stack and that using the old CGI child process and environment method fell out of favor ages ago... Lets see if we can deprecate it.📚 Documentation preview 📚: https://cpython-previews--109387.org.readthedocs.build/