[Zope-dev] xmlrpc: Syntax error at line 34: illegal character in content --> Look at what I found out
Hi chris, hi dieter, I also have this problem with using xmlrpc from a python client with zope. > > RuntimeError: Syntax error at line 34: illegal character in content > > This was the bane of one of our projects to the point where Andy re-wrote > ZMailIn to no-longer use XML-RPC. > > It's to do with stuff-which-should-probably-be-entities but we never tracked > down what wasn't encoding something when it should have done. > I'd blame the marshalling code in xmlrpclib.py myself. > > If you ever fix this, do let us know :-) > I have a Zope 2.3.1 server running as well as a Zope 2.3.2. I developed an Service-Framework on the first and then tried to install it on the 2.3.2 .. it failed I printed out the raw data of the transmission and they differ: When I call the function on Zope-2.3.1 i get this response: - OK - when I call the same function on the same backend on Zope-2.3.2 I get the following: - X-Powered-By: Zope (www.zope.org), Python (www.python.org) Content-Length: 128 Connection: close Content-Type: text/xml OK - There is some header-information in the body (that perhaps shoudn't be there) Where there any changes in Zope 2.3.1 -> 2.3.2 in the Publishing part ?? With the second response the xmllib-parser won't work as we see. any suggestions to that ?? did you guy's updated to Zope-2.3.2 recently ?? thanks for any response and hope this helps a bit .. Ulrich Eck net-labs ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] xmlrpc: Syntax error at line 34: illegal character in content
Shane Hathaway wrote: > The problem with sending binary data unencoded is line endings: \r\n > might be "helpfully" converted to \n and vice-versa. Other characters > can be encoded but apparently parsers treat and as a > real line ending. I'm not sure where this leaves me... I think this means that ultimately it's not possible to send binary data which contains 0x10 or 0x1310 in an XML-RPC message. Bummer. Especially with the ~30% bloat incurred by base64 encoding :( > In fact it's time to convert xmlrpclib to use the Expat module (via SAX) > in Python 2.1. It should speed it up dramatically. I wish we had the luxury of moving to python 2.1 :( Richard -- Richard Jones [EMAIL PROTECTED] Senior Software Developer, Bizar Software (www.bizarsoftware.com.au) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] xmlrpc: Syntax error at line 34: illegal character in content
[EMAIL PROTECTED] wrote: > > Andy McKay wrote: > > > > > Yeah, I am currently base64'ing the data, and it works. > > > > Ive seen this in some code but didnt want to say anything for fear of > > sounding stupid. It doesnt seem right somehow. > > See, this is the problem. I'm running into crunch-time at the moment, and I > really don't have time to check the validity of third-party xmlrpc code. I > honestly don't know if it's valid to send arbitrary binary data in an > xmlrpc transaction. Interestingly, it looks like xmlrpclib.py can *receive* base64-encoded data automagically, but it never *sends* it. ppml.py, found in Zope2/lib/python/Shared/DC/xml, has a convert() method which could serve as a guide for making a patch to xmlrpclib that will enable it to automatically encode in base64 when appropriate. The problem with sending binary data unencoded is line endings: \r\n might be "helpfully" converted to \n and vice-versa. Other characters can be encoded but apparently parsers treat and as a real line ending. In fact it's time to convert xmlrpclib to use the Expat module (via SAX) in Python 2.1. It should speed it up dramatically. Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] xmlrpc: Syntax error at line 34: illegal character in content
Andy McKay wrote: > > > Yeah, I am currently base64'ing the data, and it works. > > Ive seen this in some code but didnt want to say anything for fear of > sounding stupid. It doesnt seem right somehow. See, this is the problem. I'm running into crunch-time at the moment, and I really don't have time to check the validity of third-party xmlrpc code. I honestly don't know if it's valid to send arbitrary binary data in an xmlrpc transaction. Richard -- Richard Jones [EMAIL PROTECTED] Senior Software Developer, Bizar Software (www.bizarsoftware.com.au) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] xmlrpc: Syntax error at line 34: illegal character in content
> Yeah, I am currently base64'ing the data, and it works. Ive seen this in some code but didnt want to say anything for fear of sounding stupid. It doesnt seem right somehow. -- Andy McKay. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] xmlrpc: Syntax error at line 34: illegal character in content
Chris Withers wrote: > > [EMAIL PROTECTED] wrote: > > > > RuntimeError: Syntax error at line 34: illegal character in content > > This was the bane of one of our projects to the point where Andy re-wrote > ZMailIn to no-longer use XML-RPC. Yeah, I am currently base64'ing the data, and it works. > It's to do with stuff-which-should-probably-be-entities but we never tracked > down what wasn't encoding something when it should have done. > I'd blame the marshalling code in xmlrpclib.py myself. > > If you ever fix this, do let us know :-) Unfortunately, I have no time to go chasing around the xmlrpc specs :( Richard -- Richard Jones [EMAIL PROTECTED] Senior Software Developer, Bizar Software (www.bizarsoftware.com.au) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] xmlrpc: Syntax error at line 34: illegal character in content
[EMAIL PROTECTED] wrote: > > RuntimeError: Syntax error at line 34: illegal character in content This was the bane of one of our projects to the point where Andy re-wrote ZMailIn to no-longer use XML-RPC. It's to do with stuff-which-should-probably-be-entities but we never tracked down what wasn't encoding something when it should have done. I'd blame the marshalling code in xmlrpclib.py myself. If you ever fix this, do let us know :-) cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )