6 ms·
The Python maintainers are removing the module _named_ cgi, but they're not removing the support for implementing CGI scripts, which is CGIHTTPRequestHandler in
by mjw1007 1y ago
The Python maintainers are removing the module _named_ cgi, but they're not removing the support for implementing CGI scripts, which is CGIHTTPRequestHandler in the http.server module.
All that was in the cgi module was a few functions for parsing HTML form data.
- kragen 1y agoIt would be very difficult indeed to make it impossible to implement CGI scripts in Python; you'd have to remove its ability to either read environment variables or perform stdio, crippling it for many other purposes, so I didn't think they had done that. Even if they removed the whole http package, you could just copy its contents into your codebase. It's not about making Python less powerful. As a side note, though, CGIHTTPRequestHandler is for launching CGI programs (perhaps written in Rust) from a Python web server, not for writing CGI programs in Python, which is what the cgi module is for. And CGIHTTPRequestHandler is slated for removal in Python 3.15. The problem is gratuitous changes that break existing code, so you have to debug your code base and fix the new problems introduced by each new Python release. It's usually fairly straightforward and quick, but it means you can't ship the code to someone who has Python installed but doesn't know it (they're dependent on you for continued fixes), and you can't count on being able to run code you wrote yourself on an earlier Python version without a half-hour interruption to fix it. Which may break it on the older Python version.
- mjw1007 1y agoMy mistake. The support for writing CGI programs in Python is in wsgiref.handlers.CGIHandler .
- oasisaimlessly 1y ago[flagged]
- rvnx 1y agohttps://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/direct-hit.png https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/i...
- andrewflnr 1y agoI can't wait to live in the world where openly admitting your mistakes is considered evidence of disingenuousness.
- deleted 1y ago[deleted]
- deleted 1y ago[deleted]
- kragen 1y agoYes, thanks.
- oblio 1y agoOn the other hand, you can't carry old stuff to infinity.
- girvo 1y agoWhy not? Was it broken? If it was, is it easily fixable?
- oblio 1y agoWell, for one, security concerns, especially for an internet oriented component. Secondly, you have to find a reliable maintainer or several. A lot of people want stuff to be maintained indefinitely for them by unspecified "others".
- rvnx 1y agoYou don't have to find a maintainer. Not updating the system is usually a solution to such problems. At best there is a nginx or an API in front that acts a reverse proxy to clean-up/normalize the incoming requests and prevent directly exposing the service. Example: banks, airlines, hospitals, air traffic controllers, electricity companies, etc All critical services that nobody wants to touch, as it works +/-
- oblio 1y agoGuess what, all those places can just use Python 3.12 for as long as it's maintained and if they REALLY can't update, they can: a) make the system air gapped b) pay a Python consulting company to back port security fixes c) hire a Python core dev to do the system, directly OOOOR, they can just update to Python 3.13 and migrate to the equivalent Python package that's not part of the core. For sure they already use other Python packages already. We're making a mountain out of a molehill, also on behalf of places that have plenty of money to spend if push comes to shove.
- rvnx 1y ago
- cyanydeez 1y agowith the rise of docker, I assume the current gen of progress just assumes you're going to containerise your solutions. How many projects are you actively upgrading python for?