[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Phil Daintree phildaint...@gmail.com added the comment: Well maybe this should be a different bug as it is clearly not xml 1.1 related as the linue in the xml gives away :-) ?xml version=1.0? To repeat the bug ... using the webERP demo data #!/usr/bin/env python import xmlrpclib x_server = xmlrpclib.Server('http://www.weberp.org/weberp/api/api_xml-rpc.php',verbose=True) #Get the stock items defined in the demo webERP installation StockList = x_server.weberp.xmlrpc_SearchStockItems('discontinued','0','admin','weberp') if StockList[0]==0: for StockID in StockList[1]: print str(StockID) The webERP xml-rpc server uses XMLRPC for PHP http://phpxmlrpc.sourceforge.net/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Martin v. Löwis mar...@v.loewis.de added the comment: Phil: it seems you have hijacked the bug report. Don't do that. If you want to report a bug, please create a new bug report. Structure it as follows: 1. this is what I did 2. this is what happened 3. this is what should have happened instead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Phil Daintree phildaint...@gmail.com added the comment: or for less data... #!/usr/bin/env python import xmlrpclib x_server = xmlrpclib.Server('http://www.weberp.org/weberp/api/api_xml-rpc.php',verbose=True) #Get the stock items defined in the webERP installation StockList = x_server.weberp.xmlrpc_SearchStockItems('units','cm','admin','weberp') if StockList[0]==0: for StockID in StockList[1]: print str(StockID) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Martin v. Löwis mar...@v.loewis.de added the comment: Panos: you are right. The original issue still exists. However, it is not a bug in Python, but a in the expat library. So I am now closing this report as out-of-scope for Python. There is a bug report open on expat requesting support for XML 1.1, see http://sourceforge.net/tracker/?func=detailatid=110127aid=891265group_id=10127 This bug report is open since 2004. I see little hope that expat will support XML 1.1 within the next five years. I also fail to see the regression: expat has never supported XML 1.1. xmlrpclib always used expat, at least since Python 2.0. In any case, this report is about expat, not xmlrpclib, so any possible regression in xmlrpclib should be reported separately. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Changes by Martin v. Löwis mar...@v.loewis.de: -- resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Phil Daintree phildaint...@gmail.com added the comment: The field in question contains the utf-8 text: PEÇAS -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Yes, but where does this data come from? how did you feed it to the parser? And this does not relate to xml 1.1. BTW, I found this page about XML 1.1: http://www.cafeconleche.org/books/effectivexml/chapters/03.html Everything you need to know about XML 1.1 can be summed up in two rules: - Don't use it. - (For experts only) If you speak Mongolian, Yi, Cambodian, Amharic, Dhivehi, Burmese or a very few other languages and you want to write your markup (not your text but your markup) in these languages, then you can set the version attribute of the XML declaration to 1.1. Otherwise, refer to rule 1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Martin v. Löwis mar...@v.loewis.de added the comment: This has nothing to do with XML 1.1 (so closing this report as won't fix). The UTF-8 text that you present works very well: p=xml.parsers.expat.ParserCreate(encoding=utf-8) p.Parse(x\xc3\x87/x, 1) 1 The character LATIN CAPITAL LETTER C WITH CEDILLA is definitely supported in XML 1.0, so there is no need for XML 1.1 here. If this still fails to parse for you, it may be because the input is actually different, e.g. p=xml.parsers.expat.ParserCreate(encoding=utf-8) p.Parse(x#195;\x87/x, 1) Traceback (most recent call last): File stdin, line 1, in module xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 9 I.e. the input might contain the character , #, 1, 9, 5, ;, and \x87. That is ill-formed UTF-8, and the parser is right to choke on it. Even if it was declared as XML 1.1, it will still be ill-formed, because it still would be invalid UTF-8. -- resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Panos Christeas x...@hellug.gr added the comment: I'm reopening the bug, as your last comment does not cover the initial report. We are not talking about invalid UTF8 here, but legal low-ASCII values. -- resolution: wont fix - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Phil Daintree phildaint...@gmail.com added the comment: Another example - the following xml returned and displayed from verbose mode: ?xml version=1.0? methodResponse params param valuearray data valuestring0001/string/value valuestring001/string/value valuestring002/string/value valuestring100/string/value valuestring121213/string/value valuestring123456/string/value valuestring291/string/value valuestring321654/string/value valuestring580/string/value valuestringABS/string/value valuestringACTIVE/string/value valuestringAIRCON/string/value valuestringALIEJA/string/value valuestringAMP/string/value valuestringASSETS/string/value valuestringBAKE/string/value valuestringBRACE/string/value valuestringBYC/string/value valuestringCARRO/string/value valuestringCARTON/string/value valuestringCO/string/value valuestringCOMPS/string/value valuestringCULOIL/string/value valuestringDECOR/string/value valuestringDVD/string/value valuestringE/string/value valuestringFOOD/string/value valuestringHDD/string/value valuestringINF/string/value valuestringLAB/string/value valuestringLINER/string/value valuestringLL/string/value valuestringMCNBI/string/value valuestringMEDS/string/value valuestringMODEL1/string/value valuestringNEM/string/value valuestringPE#195;\x87AS/string/value valuestringPENS/string/value valuestringPHONE/string/value valuestringPLANT/string/value valuestringPRJCTR/string/value valuestringPROD/string/value valuestringSERV/string/value valuestringSOCKS/string/value valuestringSS/string/value valuestringSW/string/value valuestringTACON/string/value valuestringTEST12/string/value valuestringVEGTAB/string/value valuestringZFR/string/value /data /array/value /param /params /methodResponse will not parse with the error: File /usr/lib/python2.7/xmlrpclib.py, line 557, in feed self._parser.Parse(data, 0) xml.parsers.expat.ExpatError: not well-formed (invalid token): line 43, column 23 the following unicode characters on that line are the trouble: valuestringPE#195;\x87AS/string/value -- nosy: +Phil.Daintree ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Phil Daintree phildaint...@gmail.com added the comment: The xml parses happily at http://www.w3schools.com/xml/xml_validator.asp -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: In sample above, is \x87 one character, or 4 ascii characters? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
New submission from Panos Christeas x...@hellug.gr: The expat library (in C level) is not xml 1.1 compliant, meaning that it won't accept characters \x01-\x08,\x0b,\x0c and \x0e-\x1f . At the same time, ElementTree (or custom XML creation, such as in xmlrpclib.py:694) allow these characters to pass through. They will get blocked on the receiving side. Since 2.7, the expat library is the default parser for xml-rpc, so it this is a regression, IMHO. According to the network principal, we should accept these characters gracefully. The attached test script demonstrates that we're not xml 1.1 compliant (but instead enforce the more strict 1.0 rule) References: http://bugs.python.org/issue5166 http://en.wikipedia.org/wiki/Valid_characters_in_XML -- components: XML files: expat-test.py messages: 133301 nosy: xrg priority: normal severity: normal status: open title: expat parser not xml 1.1 (breaks xmlrpclib) type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file21580/expat-test.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Changes by Santoso Wijaya santoso.wij...@gmail.com: -- nosy: +santa4nt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11804] expat parser not xml 1.1 (breaks xmlrpclib)
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11804 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com