CORBA IDL type objects serialization problems

D. Lopez-De-Ipina dl231 at eng.cam.ac.uk
Thu Aug 5 18:34:52 CEST 1999


Hi,

I am trying to store CORBA IDL type objects in a Python shelve. I am
using Fnorb ORB. I managed to serialize CORBA.string type values but
when I try with other simple built-in types such as short, the program
crashes. I have included the code that doesn't work and the resulting
stack trace. I wonder if anybody could please explain why CORBA.string
IDL type can be serialized and not the others? If it is possible and
I have just done something wrong, would if be possible to serialize user
defined IDL types on a server without this one having knowledge of the
IDL type trasferred within an Any?

Very grateful,

Diego

#!/usr/bin/env python

import shelve

# Fnorb modules.
from Fnorb.orb import CORBA

if __name__ == '__main__':
  dictionary = shelve.open('dummy')
  dictionary['str'] = CORBA.Any(CORBA.TC_string, 'hello')
  print "dictionary['str']:", dictionary['str'].value()

  dictionary['short'] = CORBA.Any(CORBA.TC_short, 5)
  print "dictionary['short']:", dictionary['short'].value()

[dl231 at worthingtons DynAny]$ python prueba.py
dictionary['str']: hello
dictionary['short']:
Traceback (innermost last):
  File "prueba.py", line 14, in ?
    print "dictionary['short']:", dictionary['short'].value()
  File "/lce/lib/python1.5/shelve.py", line 65, in __getitem__
    return Unpickler(f).load()
TypeError: ('too many arguments; expected 1, got 2', <class
Fnorb.orb.TypeCode.ShortTypeCode at 8170908>, (tk_short,))






More information about the Python-list mailing list