Change in cgi handling of POST requests

M

Mac

We just upgraded Python to 2.6 on some of our servers and a number of
our CGI scripts broke because the cgi module has changed the way it
handles POST requests. When the 'action' attribute was not present in
the form element on an HTML page the module behaved as if the value of
the attribute was the URL which brought the user to the page with the
form, but without the query (?x=y...) part. Now FieldStorage.getvalue
() is giving the script a list of two copies of the value for some of
the parameters (folding in the parameters from the previous request)
instead of the single string it used to return for each. I searched
this newsgroup looking for a discussion of the proposal to impose this
change of behavior, and perhaps I wasn't using the right phrases in my
search, but I didn't find anything. I see that Perl still behaves the
way pre-2.6 Python used to (not that I view that as a reason for
anything). We'll work around the breakage by explicitly setting the
'action' attribute everywhere, of course, but I usually see some
discussion (often heated) of the impact of behavior changes on
existing software when something like this is in the works. Did I
miss it?

I also noted that the module is making some deprecated use of the
BaseException class.

Cheers.
 
A

Aahz

[posted & e-mailed]

We just upgraded Python to 2.6 on some of our servers and a number of
our CGI scripts broke because the cgi module has changed the way it
handles POST requests. When the 'action' attribute was not present in
the form element on an HTML page the module behaved as if the value of
the attribute was the URL which brought the user to the page with the
form, but without the query (?x=y...) part. Now FieldStorage.getvalue
() is giving the script a list of two copies of the value for some of
the parameters (folding in the parameters from the previous request)
instead of the single string it used to return for each. I searched
this newsgroup looking for a discussion of the proposal to impose this
change of behavior, and perhaps I wasn't using the right phrases in my
search, but I didn't find anything.

Interesting. Nobody has responded, so I suggest first filing a report
using bugs.python.org and then asking on python-dev (with reference to
your report).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top