By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,538 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,538 IT Pros & Developers. It's quick & easy.

Another issue in xmlrpclib

P: n/a
This was a fun problem to track down. The xmlrpclib._Method
object should do something about __str__/__repr__.

I have some code that prints out variables when an exception
happens, and if anything references one of those _Method
objects, then str/repr is called, which it tries to remote.
The real problem arises when the original exception occurred
doining some XML-RPC, so an exception is printed which when
it hits the _Method object causes another XML-RPC connection
to be made, which has an exception which when printed hits
the _Method object causes another XML-RPC connection to be
made, which has an exception which when printed ... (you get
the idea :-)

I don't know what the exact right solution for this is.
Amongst the possible solutions:

- Inherit from object, which causes many Python special
methods (stuff begining with __) to be defined (I am
using this as it is the easiest)

- In getattr, refuse to work if the method name starts
with one or two underlines

- In ServerProxy.__request filter the methodname

- Do nothing

This issue could hit in other ways. For example, if
someone makes a list of XML-RPC methods (via ServerProxy)
and then sorts them, various __cmp__ like functions
would be called and sent to the remote end.

Roger
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.