469,271 Members | 1,009 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Another issue in xmlrpclib

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
0 938

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by sashan | last post: by
2 posts views Thread by p2esp | last post: by
reply views Thread by danu kusmana | last post: by
1 post views Thread by Gabriel PASTOR | last post: by
3 posts views Thread by Rune Froysa | last post: by
reply views Thread by Willi Langenberger | last post: by
5 posts views Thread by Jonathan Ballet | last post: by
reply views Thread by Arno Stienen | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.