[python-win32] makepy.py usage and COM

Ferdinand Sousa ferdinandsousa at gmail.com
Thu Aug 21 14:36:42 CEST 2008


Hi

I have python 2.5.1, pywin32 build 212

When using the makepy utility I noticed it used to crash out with the
following traceback:

Traceback (most recent call last):
  File "C:\Python25\Lib\site-packages\win32com\client\makepy.py", line
391, in <module>
    rc = main()
  File "C:\Python25\Lib\site-packages\win32com\client\makepy.py", line
370, in main
    rc = selecttlb.SelectTlb()
  File "C:\Python25\Lib\site-packages\win32com\client\selecttlb.py",
line 148, in SelectTlb
    i.major = int(i.major, 16)
ValueError: invalid literal for int() with base 16: 'CS2'

Most likely this (last line of traceback) refers to the version number
of Adobe Photoshop Creative Suite 2.

I put the offending code in a try block and used an except block to
throw out the offending item.

for i in items:
                try:
                        i.major = int(i.major, 16)
                        i.minor = int(i.minor, 16)
        except:
                        print "the Object is",i
                        print i.major
                        print i.minor

This works fine since what I actually wanted was the Word type
library. I just wanted to point out this so that it can be corrected
(if it is indeed a bug) to accommodate non numeric version numbers in
future builds.

I just wanted pointers on how to see the methods/objects/constants
available in the Word COM object.
Any links, PDFs on COM in Python will also be useful.

Many thanks and regards,
Ferdi


More information about the python-win32 mailing list