[Python-checkins] python/dist/src/Doc/lib libcgi.tex,1.36,1.37
fdrake@users.sourceforge.net
fdrake@users.sourceforge.net
Wed, 21 Aug 2002 12:24:23 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv5430/lib
Modified Files:
libcgi.tex
Log Message:
Clarify that even though some of the relevant specifications define the
order in which form variables should be encoded in a request, a CGI script
should not rely on that since a client may not conform to those specs, or
they may not be relevant to the request.
Closes SF bug #596866.
Index: libcgi.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcgi.tex,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** libcgi.tex 26 Apr 2002 20:44:14 -0000 1.36
--- libcgi.tex 21 Aug 2002 19:24:21 -0000 1.37
***************
*** 205,212 ****
\begin{verbatim}
- from types import ListType
-
item = form.getvalue("item")
! if isinstance(item, ListType):
# The user is requesting more than one item.
else:
--- 205,210 ----
\begin{verbatim}
item = form.getvalue("item")
! if isinstance(item, list):
# The user is requesting more than one item.
else:
***************
*** 253,260 ****
more values were posted under such name. Please note that the order
in which the values are received may vary from browser to browser
! and should not be counted on. If no such form field or value exists
! then the method returns the value specified by the optional
! parameter \var{default}. This parameter defaults to \code{None} if
! not specified.
\end{methoddesc}
--- 251,262 ----
more values were posted under such name. Please note that the order
in which the values are received may vary from browser to browser
! and should not be counted on.\footnote{Note that some recent
! versions of the HTML specification do state what order the
! field values should be supplied in, but knowing whether a
! request was received from a conforming browser, or even from a
! browser at all, is tedious and error-prone.} If no such form
! field or value exists then the method returns the value specified by
! the optional parameter \var{default}. This parameter defaults to
! \code{None} if not specified.
\end{methoddesc}
***************
*** 271,275 ****
import cgi
form = cgi.FieldStorage()
! user = form.getfirst("user").toupper() # This way it's safe.
for item in form.getlist("item"):
do_something(item)
--- 273,277 ----
import cgi
form = cgi.FieldStorage()
! user = form.getfirst("user", "").toupper() # This way it's safe.
for item in form.getlist("item"):
do_something(item)