Pierre Quentel <pierre.quen...@gmail.com> added the comment:

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

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4953>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to