Discussion:
[omniORB] bug in TypeCode implementation in omniORBpython 3.0
Andrew Edem
2007-04-26 05:33:01 UTC
Permalink
Hello,

I've run into a strange problem with code that ran fine on omniORBpy 2.6
but started misbehaving on omniORBpy 3.0. Basically I do a type
comparison (operand is an Any):

if operand.typecode().kind() != CORBA.tk_objref:
raise CORBA.BAD_PARAM()

Now, this breaks in omniORBpy 3.0 because kind() returns 14 instead of
the TCKind enum value. I've traced this down to tcInternal.py, and it
seems that in the TypeCode_objref (line 556 in the 3.0 version):

self._k = desc[0]

In this case desc[0] is the integer value of the enumeration.
Origionally, the version 2.6 code had:

self._k = CORBA.tk_objref

Now, it seems like this should be changed for the version 3.0 code to:

self._k = CORBA.TCKind._item(desc[0])

Since in the 3.0 version the TypeCode_objref is used to construct type
codes for several different values of TCKind.

Can anyone confirm that this change is safe?

Thanks,
-Andrew
Duncan Grisby
2007-04-26 14:34:22 UTC
Permalink
Post by Andrew Edem
I've run into a strange problem with code that ran fine on omniORBpy 2.6
but started misbehaving on omniORBpy 3.0. Basically I do a type
raise CORBA.BAD_PARAM()
Now, this breaks in omniORBpy 3.0 because kind() returns 14 instead of
the TCKind enum value. I've traced this down to tcInternal.py, and it
self._k = desc[0]
In this case desc[0] is the integer value of the enumeration.
self._k = CORBA.tk_objref
self._k = CORBA.TCKind._item(desc[0])
Yes, your fix is the right thing to do. I've checked it in to CVS.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...