[omniORB] omniORBpy 3.0: Inconsistent return from CORBA.TypeCode.kind()

Michael omniorb at bindone.de
Thu Sep 20 20:10:45 BST 2007


Hi Arne,

this is a bug we reported earlier and that should be fixed in CVS.

Bug report from April:

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

And Duncans response:
Yes, your fix is the right thing to do. I've checked it in to CVS.

Cheers,

Duncan.

Arne Grimstrup wrote:
> Hi everyone,
> 
> I've been porting some code from omniORBpy 2.7 to omniORBpy 3.0 and have
> run
> into an odd behaviour of the CORBA.TypeCode.kind method.  When I call
> kind()
> as follows:
> 
>>>> f = CORBA.TC_boolean
>>>> f.kind()
> CORBA.tk_boolean
> 
> Yet, when I do a similar thing with an interface I've defined I see:
> 
>>>> g = CORBA.TypeCode("IDL:alma/ACS/ROdouble:1.0")
>>>> g.kind()
> 14
> 
> which is the value of CORBA.tk_objref.
> 
> omniORBpy 2.7 returns CORBA.tk_objref, so I'm confused why the two
> versions are different.
> 
> Regards,
> 
> Arne
> 
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list





More information about the omniORB-list mailing list