CGI POST problem was: How to read POSTed data

M.E.Farmer mefjr75 at hotmail.com
Sun Feb 6 00:08:46 EST 2005


Dan Perl wrote:
> I am piggybacking on Hakan's original posting because I am addressing
the
> same group of people (those with good knowledge in the standard web
> programming modules), on a related topic.  However, my question is
> independent of Hakan's.
>
> I have trouble getting a simple CGI script to work because it gets an
empty
> cgi.FieldStorage form.  I have looked into and tried to debug the
internals
> of the standard modules that are used but I cannot figure it out: how
is a
> multipart POST request parsed by CGIHTTPServer?  BTW, I am using
pyton 2.4.
>
> I found the parsing of the header in the rfc822 module used by
> BaseHTTPServer.BaseHTTPRequestHandler (through the mimetools module),
but
> that stops after the header (at the first empty line).  Where is the
parsing
> done for the POST data following the header?  I will appreciate any
pointers
> that will help me debug this problem.
>
> As a side note, I found other old reports of problems with cgi
handling POST
> requests, reports that don't seem to have had a resolution.  There is
even a
> bug reported just a few days ago (1112856) that is exactly about
multipart
> post requests.  If I understand the bug report correctly though, it
is only
> on the latest version in CVS and it states that what is in the 2.4
release
> works.  All this tells me that it could be a "fragile" part in the
standard
> library.  So it could be even a bug in the standard library, but for
now I
> am assuming that I'm doing something wrong.
>
> Thanks,
>
> Dan

Dan,
I was wondering how you were coming with your project.
I had wondered if i had missed something going the CherryPy route
instead of CGI. Now I see that you have had a bit of a snag , sorry to
hear that.
I am glad you are at least learning new things, 'cause if you had used
CherryPy2 you would have be done by now :P
M.E.Farmer




More information about the Python-list mailing list