This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bkline
Recipients bkline
Date 2009-02-21.19:11:48
SpamBayes Score 1.563758e-10
Marked as misclassified No
Message-id <1235243512.17.0.731468064037.issue5340@psf.upfronthosting.co.za>
In-reply-to
Content
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 the python
mailing list 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 didn't get many responses when I
asked for pointers to this discussion, but the few I did get were from
people who were as surprised as we were.  It's not clear to us (or to
those who responded on the mailing list) that the applicable RFCs
provide completely clear and unambiguous guidance as to which behavior
is correct, but even if the new behavior is correct, it is unusual to
have changes to the library which break existing code introduced without
any discussion of the impact, or transition period, or options to
preserve the previous behavior.  For what it's worth, it appears that
Perl and PHP (which probably account for the bulk of non-Python CGI
scripts in the wild) both behave the way the pre-2.6 cgi module did.  We
have a workaround (modify all our CGI scripts to explicitly set the
action attribute without the parameter suffix), but I was asked by one
of the regulars on the mailing list to file a bug report here, so I'm
complying with that request.

It appears that the breaking change was introduced with
http://svn.python.org/view?rev=64447&view=rev in connection with
http://bugs.python.org/issue1817.

See
http://mail.python.org/pipermail/python-list/2009-February/529130.html
for repro instructions.
History
Date User Action Args
2009-02-21 19:11:52bklinesetrecipients: + bkline
2009-02-21 19:11:52bklinesetmessageid: <1235243512.17.0.731468064037.issue5340@psf.upfronthosting.co.za>
2009-02-21 19:11:50bklinelinkissue5340 messages
2009-02-21 19:11:48bklinecreate