cgi.py -- anybody using it?

Ian Bicking ianb at colorstudy.com
Sat Apr 5 02:58:36 EST 2003


On Fri, 2003-04-04 at 17:58, John J Lee wrote:
> I just tried testing some HTML form upload code using cgi.py, and
> discovered that it wants lower-case HTTP headers :-/

Have you actually seen this behavior, or are you getting this from
reading the code?  I don't even think the code handles headers -- the
CGI process turns headers into environmental variables, and case isn't
preserved in that process.

In some places you may read code that uses the mimetools module to parse
headers.  It has a dictionary interface, but keys are case-insensitive,
so if it uses m["content-type"] it's still work with Content-Type or
somesuch.

And yes, the cgi module is in very active use, not just for cgi
programs, but in many systems that handle the web (since it has
functions for query string parsing and many other things).

  Ian







More information about the Python-list mailing list