[Tutor] immutable objects

Premnath Sah prem.sah at gmail.com
Wed Nov 1 05:45:26 CET 2006


On 10/31/06, Danny Yoo <dyoo at hkn.eecs.berkeley.edu> wrote:
>
> > Im facing a problem with SOAPpy which checks for recursive objects using
> > id(obj).
> >
> > In my case value for 2 SOAP headers are same and iam getting a recursion
> > error. if i pass different object with same value SOAPpy does not
> complain
> > (by using str(value) and unicode(value)).
>
> If you can include a stack trace of that error with SOAPpy, that would be
> excellent.  This sounds bizarre.
>
> You won't be able to do anything with the ints: some of them are
> internally interned by the runtime, and you can't control this.  So I'd
> instead focus on why SOAPpy is failing.  It shouldn't have to worry about
> recursively traversing the ints: they don't have any structure to
> traverse!  So a stack trace would be useful.
>


here is the stack
trace. i know that SOAPpy is doing wrong by not checking the type of
the element along with id(ele).
I thought if there is any work around the problem i could use that without
upgrading SOAPpy after it is fixed.

>>> import SOAPpy
>>> rmt = SOAPpy.SOAPProxy(url, header =
SOAPpy.Types.headerType(data={'username':
'prem', 'password': 'prem'}))
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'url' is not defined
>>> url = "http://soap.test.com/"
>>> rmt = SOAPpy.SOAPProxy(url, header =
SOAPpy.Types.headerType(data={'username':
'prem', 'password': 'prem'}))
>>> rmt.testcall()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/cv/vendor/lib/python2.4/site-packages/SOAPpy/Client.py", line 453, in
__call__
return self.__r_call(*args, **kw)
File "/cv/vendor/lib/python2.4/site-packages/SOAPpy/Client.py", line 475, in
__r_call
self.__hd, self.__ma)
File "/cv/vendor/lib/python2.4/site-packages/SOAPpy/Client.py", line 338, in
__call
config = self.config, noroot = self.noroot)
File "/cv/vendor/lib/python2.4/site-packages/SOAPpy/SOAPBuilder.py", line
624, in buildSOAP
return t.build()
File "/cv/vendor/lib/python2.4/site-packages/SOAPpy/SOAPBuilder.py", line
112, in build
self.dump(self.header, "Header", typed = typed)
File "/cv/vendor/lib/python2.4/site-packages/SOAPpy/SOAPBuilder.py", line
294, in dump
meth(obj, tag, typed, ns_map)
File "/cv/vendor/lib/python2.4/site-packages/SOAPpy/SOAPBuilder.py", line
580, in dump_instance
self.dump(getattr(obj,k), k, typed, ns_map)
File "/cv/vendor/lib/python2.4/site-packages/SOAPpy/SOAPBuilder.py", line
294, in dump
meth(obj, tag, typed, ns_map)
File "/cv/vendor/lib/python2.4/site-packages/SOAPpy/SOAPBuilder.py", line
358, in dump_string
id = self.checkref(obj, tag, ns_map)
File "/cv/vendor/lib/python2.4/site-packages/SOAPpy/SOAPBuilder.py", line
260, in checkref
raise RecursionError, "Cannot serialize recursive object"
SOAPpy.Errors.RecursionError: <Error : Cannot serialize recursive object>
>>>

-- 
With Regards,
Premnath Sah T. H.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061101/413d46e0/attachment.htm 


More information about the Tutor mailing list