[Zope3-Users] XMLRPC Method with **kwargs

Jeremy Roberts jerbear at incrediblepear.com
Thu Dec 13 21:53:39 EST 2007


Darryl Cousins wrote:
> Hi Jeremy,
> 
> On Thu, 2007-12-13 at 19:29 -0500, Jeremy Roberts wrote:
>> class ToolCodeXMLRPC(MethodPublisher):
>>      """An XMLRPC view for ToolCode objects."""
>>
>>      def renderCode(self, **kwargs):
>>          return self.context.renderCode(kwargs) 
> 
> try using:
> 
>   def renderCode(self, **kwargs):
>       return self.context.renderCode(**kwargs) # !!
> 
> Regards,
> Darryl
> 

Hey Darryl,

Thanks for the suggestion.
I tried the above edit (instructing python to unpack the kwargs 
dictionary back into keyword arguments with the ** operator) to no avail.

With this edit in place, I still get the same error:
Unexpected Zope exception: TypeError: renderCode() takes at most 1 
argument (2 given)

I'm going to poke around the Zope3 zope.publisher.xmlrpc to see if I can 
gain any insight by finding the code that raises this exception.

If I find anything useful I'll post back to the list...

Thanks!
-Jer




More information about the Zope3-users mailing list