Re: bug in Makepy

2006-06-23 Thread Jim
 Always interpret it as hex, or always interpret it as decimal.

I see what you mean.  But I don't think I'll worry about it.

   -- Jim

-- 
http://mail.python.org/mailman/listinfo/python-list


bug in Makepy

2006-06-22 Thread Jim
I was trying to use Makepy to wrap a typelib, but couldn't find the one
I wanted in the list of libs offered, and couldn't find a way to browse
to a specific one.

Turns out the reason was that the lib was version 10, which was listed
in the registry in hex as version a.0.  The tlb chooser in Makepy
rejects hex values. The author was evidently aware of this, since there
is a comment in the code about it.

Here is a fix -- add 4 lines in
site-packages\win32com\client\selecttlb.py:

try:
# For some reason, this code used to assume the values were hex.
# This seems to not be true - particularly for CDO 1.21
# *sigh* - it appears there are no rules here at all, so when we need
# to know the info, we must load the tlb by filename and request it.
# The Resolve() method on the TypelibSpec does this.
major = int(major_minor[0])
minor = int(major_minor[1])
except ValueError: # try again in case values are in hex
=  try:
=  major = int(major_minor[0], 16)
=  minor = int(major_minor[1], 16)
=  except ValueError: # crap in the registry!
continue

Hope this helps someone.

  -- Jim

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: bug in Makepy

2006-06-22 Thread Jim
 This only works if the hexadecimal representation has digits in [A-F].
 What if the stored value is 10, but in hexadecimal?

I don't get what you mean.  If the value is 10, but in hexadecimal,
isn't that A?

The problem my fix solves is where the folder under the typelib guid is
named something like a.0.  It does what I need.  If you see a case it
doesn't handle, maybe you could propose a better fix?

  -- Jim

-- 
http://mail.python.org/mailman/listinfo/python-list