Author quentel
Recipients amaury.forgeotdarc, barry, eric.araujo, erob, flox, georg.brandl, ggenellina, oopos, pebbe, pitrou, quentel, r.david.murray, tcourbon, tobias, v+python, vstinner
Date 2011-01-13.15:38:33
SpamBayes Score 5.30555e-09
Marked as misclassified No
Message-id <1294933115.28.0.459255192572.issue4953@psf.upfronthosting.co.za>
In-reply-to
Content
Ok, thanks. Here is a summary of the API changes :

- the argument fp passed to FieldStorage is either an instance of (a subclass of) io.TextIOBase with a "buffer" attribute for the underlying binary layer (thus, it can't be a StringIO instance) ; or an object with read() and readline() methods that return bytes
Defaults to sys.stdin

- 2 additional arguments can be passed to the FieldStorage constructor :
. stream_encoding : the encoding used by the user agent to encode submitted data. It must be the same as the content-type of the HTML page where the form stands. Defaults to utf-8
. charset : the encoding used by the CGI script (the one used by the print() function to encode and send to sys.stdout). It must be the same as the charset in the content-type header sent by this script. Defaults to None, in which case the default encoding of sys.stdout is used

- the only change in the object returned by FieldStorage() is that, if a field represents a file (its argument filename is not None), the read() method on this field returns bytes, and its attribute "value" is a bytestring, not a string
History
Date User Action Args
2011-01-13 15:38:35quentelsetrecipients: + quentel, barry, georg.brandl, amaury.forgeotdarc, ggenellina, pitrou, vstinner, eric.araujo, v+python, r.david.murray, oopos, tcourbon, tobias, flox, pebbe, erob
2011-01-13 15:38:35quentelsetmessageid: <1294933115.28.0.459255192572.issue4953@psf.upfronthosting.co.za>
2011-01-13 15:38:33quentellinkissue4953 messages
2011-01-13 15:38:33quentelcreate