jvandal / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

WSGI 3.2: Mixed POST and search string--FieldStorage doesn't contain search string #201

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Situation: Have a page with form fields, and accesses it with a URL that has a 
search string

    https://host/bla/add_data?pub_id=2

In the WSGI application function, create a FieldStorage object

    FieldStorage( fp = environ['wsgi.input'], environ = environ, keep_blank_values = 1 )

Problem, WSGI 3.2, this FieldStorage object contains all the form fields, but 
not the search string item.

This depends somehow either on WSGI or other software in the environment.

On Scientific Linux 5.5,
    mod_wsgi 3.2
    (httpd 2.2.3 distro, python 2.5.4 built)
shows the problem

On Ubuntu 10.5
    libapache2-mod-wsgi 2.8.2ubuntu1
    (apache 2.2.14 distro, python 2.6.5 distro)
does not show the problem

Cheers!

Original issue reported on code.google.com by Stevan.W...@gmail.com on 11 Jun 2010 at 12:15

GoogleCodeExporter commented 8 years ago
If there is a problem with this, it is going to be due to differences in 
cgi.FieldStorage implementation between those two Python versions.

Have you looked at the source code for cgi.FieldStorage in those two Python 
versions to see if they actually do the same thing? My quick scan suggests they 
don't and the latter version does take into consideration the query string.

Thus, it an issue with mod_wsgi but expected behaviour for those respective 
Python versions from what I can see.

Original comment by Graham.Dumpleton@gmail.com on 13 Jun 2010 at 1:34

GoogleCodeExporter commented 8 years ago
Hi Graham,

All the cgi.py files I can find show __version__ = "2.6"
Any other ideas?

This is still a problem for me.  I can surely re-work these pages, but I would 
prefer to understand what went wrong.

I want to add:

My description of the problem is incomplete:

This happens only when submitting from a WSGI script back to itself, 
as with an HTML form with action="".  

The web browser still displays the URL with a search string, like
     https://host/bla/add_data?pub_id=2
but the pub_id=2 is not in the FieldStorage structure.

Original comment by Stevan.W...@gmail.com on 15 Jun 2010 at 11:47

GoogleCodeExporter commented 8 years ago
The version string hasn't been updated between versions.

Search for 'qs_on_post' in Python 2.5 and Python 2.6 versions of cgi.py. You 
will see that latter has it. That value appears to relate to using query string 
fields in conjunction with a POST.

Original comment by Graham.Dumpleton@gmail.com on 15 Jun 2010 at 11:50

GoogleCodeExporter commented 8 years ago
I double-checked the cgi.py files.  Although they showed the same version 
strings, they were in fact different, in the way you say.

But just what they now do, and why the behavior changed, I can't seem to suss 
out.

I'm still not sure what to do about this.  I'll see if I can write the cgi.py 
author.

Original comment by Stevan.W...@gmail.com on 13 Jul 2010 at 12:49

GoogleCodeExporter commented 8 years ago
There is no point mailing the cgi module author listed in the file as they 
likely didn't make the changes. The correct place to ask is the python-dev 
mailing list. Only do that though after you have gone through the Python issue 
tracker to see if the details of why are recorded there.

Original comment by Graham.Dumpleton@gmail.com on 13 Jul 2010 at 7:59