BaseHTTPServer weirdness

Ron Garret rNOSPAMon at flownet.com
Tue Sep 12 01:46:03 EDT 2006


In article <4505f897$0$75041$14726298 at news.sunsite.dk>,
 Damjan <gdamjan at gmail.com> wrote:

> >> But basically, you aren't providing a CGI environment, and that's why
> >> cgi.parse() isn't working.
> > 
> > Clearly.  So what should I be doing? 
> 
> Probably you'll need to read the source of cgi.parse_qs (like Steve did) and
> see what it needs from os.environ and then provide that (either in
> os.environ or in a custom environ dictionary).

I ended up just copying and hacking the code.  It was only a dozen lines 
or so.  But it still feels wrong.

> BUT why don't you use WSGI?

Because BaseHTTPServer does everything I need except for this one thing.  
Why use a sledge hammer to squish a gnat?

rg



More information about the Python-list mailing list