[python-win32] win32com- Type mismatch on a string... Possible hash key collision?
timr at probo.com
Wed Jan 2 22:56:15 CET 2008
Reedick, Andrew wrote:
> It's odd because a) it works in ActiveState Perl, b) other methods in
> the object work just fine in Python, and c) it looks suspiciously like a
> key collision in an internal hash.
No, I think the debug log disproves this. The second call does not find
its attributes in the cache, and goes to fetch a different property ID.
> The following method works successfully:
> a = self.tdc.Customization.Fields.Field("REQ", "RQ_REQ_ID")
> print a.ColumnName
> but the following fails:
> b = self.tdc.Customization.Fields.Fields("BUG")
> I think the problem is "...Fields.Fields(...)" The two Fields objects
> are different objects but happen to have the same name. (The 1st Fields
> is a CustomizationFields object, and the 2nd Fields is TDField object
> with different properties and different methods.)
Actually, the 2nd Fields is an IList object which contains a list of
TDFields. I'm not 100% sure what the interface to an IList is, but you
might try ["BUG"] instead of ("BUG").
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32