News for hackers. Stuff that matters.
Re:Serving 200M requests per day with a CGI-bin by kragen on Sunday July 06, 2025 @04:47AM (#44478961)
It 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.

Re:Serving 200M requests per day with a CGI-bin by oblio on Sunday July 06, 2025 @08:15AM (#44480090)
On the other hand, you can't carry old stuff to infinity.
Re:Serving 200M requests per day with a CGI-bin by girvo on Sunday July 06, 2025 @09:34AM (#44480685)
Why not? Was it broken? If it was, is it easily fixable?
Re:Serving 200M requests per day with a CGI-bin by rvnx on Sunday July 06, 2025 @09:46AM (#44480786)
It takes time, and this means that instead of working on something else, their time is locked on this.
Re:Serving 200M requests per day with a CGI-bin by LtWorf on Sunday July 06, 2025 @11:27AM (#44481566)
The CGI standard hasn't changed… what changes did the module need?
Re:Serving 200M requests per day with a CGI-bin by oblio on Sunday July 06, 2025 @09:36AM (#44480698)
Well, 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".

Re:Serving 200M requests per day with a CGI-bin by rvnx on Sunday July 06, 2025 @09:38AM (#44480722)
You 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 +/-

Re:Serving 200M requests per day with a CGI-bin by oblio on Sunday July 06, 2025 @12:45PM (#44482189)
Guess 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.

Re:Serving 200M requests per day with a CGI-bin by rvnx on Sunday July 06, 2025 @04:05PM (#44483593)
I think it may be easier to backport CGI to a new version of Python rather than backport security fixes
Re:Serving 200M requests per day with a CGI-bin by oblio on Sunday July 06, 2025 @07:43PM (#44485194)
I agree.
Re:Serving 200M requests per day with a CGI-bin by sitkack on Sunday July 06, 2025 @02:33PM (#44482966)
You can't carry anything to infinity, by definition. Please argue constructively.
Re:Serving 200M requests per day with a CGI-bin by oblio on Sunday July 06, 2025 @04:02PM (#44483579)
Then remove the hyperbole and be merry.

You can't carry everything to very long term horizons, especially whose user base is 2 people and 1 squirrel.

People who want otherwise should volunteer to maintain what they want kept.

Re:Serving 200M requests per day with a CGI-bin by kragen on Sunday July 06, 2025 @05:27PM (#44484208)
The social problem is that maintaining backward compatibility with boring technology is considered harmful by the current Python community. There was an active campaign to extract pledges from popular Python library authors to break compatibility with Python 2 by a certain date. This means that if you are volunteering to maintain what you want kept, you had better not tell anyone about it.
Re:Serving 200M requests per day with a CGI-bin by cb321 on Sunday July 06, 2025 @06:40PM (#44484771)
Do you have any URIs or back up links? Encouragement to actively break compatibility sounds like "inciting murder" vs. a more tame "don't expend effort (go to medical school)" to save folks.

{ Oh, and before anyone jumps on me, this is only an analogy as it relates to freshman moral philosophy courses, not an attempt by me to over-dramatize - that is more the fault of said courses trying to engage 18 year olds. :-) I'm mostly interested in the active-passive details of the pledge campaign. }

Re:Serving 200M requests per day with a CGI-bin by kragen on Sunday July 06, 2025 @07:50PM (#44485249)
Re:Serving 200M requests per day with a CGI-bin by cb321 on Monday July 07, 2025 @05:52AM (#44488522)
Thanks!
Re:Serving 200M requests per day with a CGI-bin by kragen on Monday July 07, 2025 @08:50PM (#44495962)
Sure!
Re:Serving 200M requests per day with a CGI-bin by mjw1007 on Sunday July 06, 2025 @06:14AM (#44479396)
My mistake.

The support for writing CGI programs in Python is in wsgiref.handlers.CGIHandler .

Re:Serving 200M requests per day with a CGI-bin by oasisaimlessly on Sunday July 06, 2025 @07:47AM (#44479893)
Confidently incorrect, doesn't learn, apologizes profusely; LLM impression?
Re:Serving 200M requests per day with a CGI-bin by rvnx on Sunday July 06, 2025 @09:24AM (#44480610)
Re:Serving 200M requests per day with a CGI-bin by andrewflnr on Sunday July 06, 2025 @12:14PM (#44481972)
I can't wait to live in the world where openly admitting your mistakes is considered evidence of disingenuousness.
Re:Serving 200M requests per day with a CGI-bin by kragen on Sunday July 06, 2025 @07:49PM (#44485242)
Yes, thanks.
Re:Serving 200M requests per day with a CGI-bin by cyanydeez on Sunday July 06, 2025 @08:49AM (#44480359)
with 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?