[issue7165] xmlrpc.server assumes sys.stdout will have a buffer attribute

Antoine Pitrou report at bugs.python.org
Wed Oct 21 20:27:47 CEST 2009


Antoine Pitrou <pitrou at free.fr> added the comment:

Well this is in the CGI implementation, and it's reasonable to assume
that CGI will only be used with a real stream. Besides, the encoding
used with stdout must be the xmlrpc encoding (probably utf-8), not the
default encoding of standard streams on the system, which means direct
access to the underlying binary stream must be possible.

(however, _marshaled_dispatch() is quite strange in that it accepts str
but returns bytes)

I propose to fix test_xmlrpc instead so that it uses a BytesIO wrapped
in a TextIOWrapper. Patch included.

----------
keywords: +patch
nosy: +loewis, pitrou
Added file: http://bugs.python.org/file15176/test_xmlrpc.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7165>
_______________________________________


More information about the Python-bugs-list mailing list