[issue10066] xmlrpclib does not handle some non-printable characters properly

2016-01-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> xmlrpc library returns string which contain null ( \x00 ) ___ Python tracker

[issue10066] xmlrpclib does not handle some non-printable characters properly

2010-10-14 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: My bad, I read too fast. Peter: Can you rework your patch to address Martin’s review? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10066

[issue10066] xmlrpclib does not handle some non-printable characters properly

2010-10-13 Thread Peter Gyorko
Peter Gyorko gyor...@balabit.hu added the comment: The shortest code which can trigger this error is the following: import xmlrpclib print xmlrpclib.dumps(('\x01',)) params param valuestring/string/value /param /params As you can see, the escape method does not care about non-printable

[issue10066] xmlrpclib does not handle some non-printable characters properly

2010-10-13 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: No, CDATA is not an appropriate mechanism to encapsulate bytes in XML. The data in the CDATA section must still match the Char production, and it must still follow the encoding. -- ___ Python

[issue10066] xmlrpclib does not handle some non-printable characters properly

2010-10-13 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks for the new patch. I suggest one style change before committing: if re.search(snip, s) is not None: Agree that CDATA is not appropriate. Martin: I’m reopening the bug in reaction to your message “I could accept a patch that rejects

[issue10066] xmlrpclib does not handle some non-printable characters properly

2010-10-13 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Éric, I think the patch needs some rework. First, it is incorrect/incomplete: please see the Char definition for a complete list of characters that must be excluded. This then raises a Unicode vs. bytes issue, where invalid Unicode

[issue10066] xmlrpclib does not handle some non-printable characters properly

2010-10-12 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks for the report. Unfortunately, 2.6 only gets security fixes, not general bug fixes; can you tell if this applies to 2.7, 3.1 and 3.2? If you have a small script that displays the problem, please attach it. -- nosy:

[issue10066] xmlrpclib does not handle some non-printable characters properly

2010-10-12 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: The patch is incorrect. Even though this may let get these characters through, the other end will have no clue that \x is meant as an escape. Please face the ugly truth: XML (and hence XML-RPC) just does not support these characters, see

[issue10066] xmlrpclib does not handle some non-printable characters properly

2010-10-11 Thread Peter Gyorko
New submission from Peter Gyorko gyor...@balabit.hu: If I add a string to the response, which contains non-printable characters, the output will not be parsed by the most of the XML parsers (I tried with XML-RPC for PHP). Here is my quick and dirty fix: --- a/Lib/xmlrpclib.py +++