Doubt about Pickle and CORBA IDL types
D. Lopez-De-Ipina
dl231 at eng.cam.ac.uk
Wed Aug 4 13:11:34 EDT 1999
Hi,
I want to serialize some data of CORBA IDL types in a shelve. I have
just made a very simple program that serialises a CORBA.string and a
CORBA.short, the first one works but the second one not. Could anybody
please tell me why this happens?:
#!/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 81705e0>, (tk_short,))
Thanks,
Diego
More information about the Python-list
mailing list