Issue 9006: xml-rpc Server object does not propagate the encoding to Unmarshaller (original) (raw)

Created on 2010-06-16 09:20 by Timothée.CEZARD, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
xmlrpc_bug.tar.gz Timothée.CEZARD,2010-06-16 09:20 tar ball containing two scripts reproducing the issue
xmlrpclib_fixed.py Timothée.CEZARD,2010-06-16 14:44 a fixed version of the xmlrpclib module
test_xmlrpc_encoding-2.7.patch serhiy.storchaka,2016-01-16 17:51 review
test_xmlrpc_encoding-3.5.patch serhiy.storchaka,2016-01-16 17:51 review
Messages (6)
msg107910 - (view) Author: Timothée CEZARD (Timothée.CEZARD) Date: 2010-06-16 09:20
xmlrpc cleint (Server class) default encoding is utf-8 it can be modified through the encoding keyword parameter. This parameter is not passed to the Unmarshaller that decode the bit flow causing the server to crash attached is two script reproducing the issue
msg107918 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-06-16 12:20
Thank your for reporting this bug. Are you able to reproduce the bug with current development versions, a.k.a. 2.7 (svn trunk, or the rc release) and 3.2 (py3k branch)? Only security and documentation fixes go in stable releases like 2.6 and 3.1. Also, please upload separate files instead of archives, it’s easier for review. Thanks again!
msg107924 - (view) Author: Timothée CEZARD (Timothée.CEZARD) Date: 2010-06-16 14:44
With 2.7 I'm getting another exception xml.parsers.expat.ExpatError: not well-formed (invalid token): line 5, column 15 where with 2.6 I was getting UnicodeDecodeError: 'utf8' codec can't decode byte 0xa3 in position 0: unexpected code byte I didn't try with 3.2 yet. I also "fixed" the bug in 2.6 by passing the encoding stored in ServerProxy to Transport and then Unmarshaller. I probably did not do it the proper way but it works now
msg120998 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-12 00:41
Could you reupload your fix as a diff instead of a whole file? See http://www.python.org/dev/patches/ for some help.
msg258397 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-01-16 17:51
xmlrpc uses XML. This format includes information about the encoding and doesn't need external specification. The server in the example is not correct. It generates XML with default XML declaration that implies the UTF-8 encoding, but the body is encoded with non-UTF-8 encoding. If add the argument encoding='UTF-8' the example works. But this feature is not covered by tests. Proposed patch adds tests for non-default client and server encodings. No changes for the xmlrpc module itself is needed.
msg258535 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-01-18 17:40
New changeset 04e95f05aafe by Serhiy Storchaka in branch '2.7': Issue #9006: Added tests for XML RPC with non-UTF-8 encoding. https://hg.python.org/cpython/rev/04e95f05aafe New changeset 59cb8811286a by Serhiy Storchaka in branch '3.5': Issue #9006: Added tests for XML RPC with non-UTF-8 encoding. https://hg.python.org/cpython/rev/59cb8811286a New changeset 96a7603d25ea by Serhiy Storchaka in branch 'default': Issue #9006: Added tests for XML RPC with non-UTF-8 encoding. https://hg.python.org/cpython/rev/96a7603d25ea
History
Date User Action Args
2022-04-11 14:57:02 admin set github: 53252
2016-01-18 17:43:09 serhiy.storchaka set status: open -> closedresolution: rejectedstage: patch review -> resolved
2016-01-18 17:40:50 python-dev set nosy: + python-devmessages: +
2016-01-16 17:51:24 serhiy.storchaka set files: + test_xmlrpc_encoding-3.5.patch
2016-01-16 17:51:07 serhiy.storchaka set files: + test_xmlrpc_encoding-2.7.patchassignee: serhiy.storchakakeywords: + patchstage: patch reviewversions: + Python 3.5, Python 3.6, - Python 3.1, Python 3.2nosy: + serhiy.storchakamessages: + components: + Teststype: behavior -> enhancement
2010-11-12 00:41:47 eric.araujo set versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6nosy: + loewismessages: + type: crash -> behavior
2010-06-16 14:44:55 Timothée.CEZARD set files: + xmlrpclib_fixed.pymessages: +
2010-06-16 12:20:54 eric.araujo set nosy: + eric.araujomessages: +
2010-06-16 09:20:34 Timothée.CEZARD create