You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
After seeing the absence of SimpleXMLRPCServer from xmlrpc.server, I decided to use the given future.backports.xmlrpc.server.
One big change from the 2.x version is encoding the xml response, creating a newbytes (from SimpleXMLRPCDispatcher's _marshaled_dispatch): return response.encode(self.encoding)
This encoding - creation of a newbytes object, wasn't there in 2.7, making me believe the new version wants to send encoded bytes instead of strings over the network, but later, when the data is written using SimpleXMLRPCRequestHandler's do_POST: self.wfile.write(response)
What actually happens there is socket.py doing str() on the newbytes object, creating a string containing the b prefix: "b\'<xml...>'"
(note, it's not b"<xml...>", the b is actually in the string)
This string isn't read well later by xmlrpc.client.ProxyServer, which uses a parser that says this is an invalid xml string.
Hi all,
After seeing the absence of SimpleXMLRPCServer from xmlrpc.server, I decided to use the given future.backports.xmlrpc.server.
One big change from the 2.x version is encoding the xml response, creating a newbytes (from SimpleXMLRPCDispatcher's _marshaled_dispatch):
return response.encode(self.encoding)
This encoding - creation of a newbytes object, wasn't there in 2.7, making me believe the new version wants to send encoded bytes instead of strings over the network, but later, when the data is written using SimpleXMLRPCRequestHandler's do_POST:
self.wfile.write(response)
What actually happens there is socket.py doing str() on the newbytes object, creating a string containing the b prefix:
"b\'<xml...>'"
(note, it's not b"<xml...>", the b is actually in the string)
This string isn't read well later by xmlrpc.client.ProxyServer, which uses a parser that says this is an invalid xml string.
Here's a super simple project I made that showcases the problem, with a 2.x vs futurized code
https://github.com/Amir-Hadadi/xmlrpc-future-test
The text was updated successfully, but these errors were encountered: