Python finally offloads some batteries
Python finally offloads some batteries
Posted Mar 17, 2022 17:19 UTC (Thu) by mb (subscriber, #50428)Parent article: Python finally offloads some batteries
I bet that's being used in thousands of in-production scripts. Including some of mine.
Why does this have to be removed?
What are the alternatives (that aren't deprecated tomorrow)?
Posted Mar 17, 2022 23:06 UTC (Thu)
by cjwatson (subscriber, #7322)
[Link] (5 responses)
Posted Mar 18, 2022 7:03 UTC (Fri)
by mb (subscriber, #50428)
[Link] (1 responses)
It works just fine for me.
I'm not against removing unused or rarely used modules.
Posted Mar 18, 2022 18:48 UTC (Fri)
by cjwatson (subscriber, #7322)
[Link]
Posted Mar 18, 2022 18:35 UTC (Fri)
by edgewood (subscriber, #1123)
[Link] (2 responses)
But I do need to parse URL and form parameters, and use FieldStorage for that. I was planning to just copy cgi.py when it went EOL, but if there's a better replacement I'll use it.
Posted Mar 18, 2022 18:49 UTC (Fri)
by cjwatson (subscriber, #7322)
[Link] (1 responses)
Posted Mar 27, 2022 13:53 UTC (Sun)
by edgewood (subscriber, #1123)
[Link]
I just had a chance to convert a script that used cgi.FieldStorage to use urllib.parse.parse_qs instead, and it only took me about a half an hour. It helped that I had a helper method to smooth over some weirdness caused by the interaction of FieldStorage and the structure of my existing HTML, and a lot of the accesses of the FieldStorage values already went through that method. I just changed it to access the parse_qs dictionary instead, and changed a handful of sites that directly accessed FieldStorage values directly to call the helper, and it all worked.
My previous plan was to vendor cgi.py, so thank you for responding to my question and pointing me to how I could use supported stdlib code!
Posted Mar 18, 2022 22:07 UTC (Fri)
by flussence (guest, #85566)
[Link]
Python finally offloads some batteries
Python finally offloads some batteries
What's broken with it?
But removing those widely used modules, like cgi, is going to cause major waste of developer time in the order of hundreds of thousands of hours. That's not Ok and it will hurt Python's reputation. Again.
Python finally offloads some batteries
Python finally offloads some batteries
Python finally offloads some batteries
Python finally offloads some batteries
Python finally offloads some batteries