472,791 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,791 software developers and data experts.

Bug in COM Makepy utility? (ActivePython 2.4)

When I use the COM Makepy utility on one computer with WindowsXP,
ActivePython 2.3 and I select the library Microsoft Word 10.0 Object
Library (8.2), things work fine.
When I have WindowsXP, ActivePython 2.4 (build 247) and Microsoft Word
11.0 Object Library (8.3), then I get the following SyntaxError, and on
two different computers I tested this. More on the error below, but has
anyone else had this problem? Will there soon be a newer build of
ActivePython? I've never used the standard Python distribution with
manually installed win32all package, just because its so easy to deploy
ActivePython. Should I consider switching, now that I'm on the topic?

Generating to C:\Python24\lib\site-packages\win32com\gen_py\00020905-0000-0000-C000-000000000046x0x8x3\__init__.py

Building definitions from type library...
Importing module
Failed to execute command:
from win32com.client import makepy;makepy.main()
Traceback (most recent call last):
line 103, in HandleToolCommand
exec "%s\n" % pyCmd
File "<string>", line 1, in ?
File "C:\Python24\lib\site-packages\win32com\client\makepy.py", line
363, in main
GenerateFromTypeLibSpec(arg, f, verboseLevel = verboseLevel,
bForDemand = bForDemand, bBuildHidden = hiddenSpec)
File "C:\Python24\lib\site-packages\win32com\client\makepy.py", line
274, in GenerateFromTypeLibSpec
gencache.AddModuleToCache(info.clsid, info.lcid, info.major,
File "C:\Python24\Lib\site-packages\win32com\client\gencache.py",
line 555, in AddModuleToCache
mod = _GetModule(fname)
File "C:\Python24\Lib\site-packages\win32com\client\gencache.py",
line 634, in _GetModule
mod = __import__(mod_name)
line 2831
'{00020960-0000-0000-C000-000000000046}' : 'Pane',
'{00020961-0000-0000-C000-000000000046}' : 'Windows',
SyntaxError: invalid syntax
I don't entirely understand the error (I'm rather ignorant of the whole
process Makepy is doing, come to think of it...). First of all, when I
load the file with the alleged syntax error into Scite, the line where
the caret is pointing to is actually 2838, not line 2831. Further, I
cannot detect any syntax errors based on visual inspection. In fact,
when I copy/paste lines 2830-2840 into a new script and put "d = {"
before the lines and "}" after the lines, it is syntactically valid
python that executes without complaint. I don't know how "dynamically"
this file is being generated, but somethin' ain't right.

Oct 6 '05 #1
1 2659
After exploring the bug database I discovered that this bug has been
reported since March, and appears to derive from a bug in Python


It apparently only happens when the code generated by Makepy is really
big (which it is for Word or Excel).

So my options are to downgrade from Python 2.4.1 to 2.3.5 or to use
Late Binding instead of Early Binding (as described in Hammond and
Robinson, Ch. 12). The easiest path will be to use Early Binding,
because as far as I can tell the only significant changes to code will
be that I have to use integer literals instead of named constants. In
my case this means replacing
'win32com.client.constants.wdSendToNewDocument' with '0' (zero).

Oct 7 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: bk | last post by:
hi, i'm using pythonwin 2.2.3 my programm reads and write the outlook-adress book using COM. for this i have to use the makepy utility. after i have run the utiltity everything is fine and i...
by: Gerson Kurz | last post by:
I have problems getting "COM makepy" working in ActivePython 2.3.2. This is what happens when I start "COM makepy" from the Pythonwin Menu: PythonWin 2.3.2 (#49, Nov 6 2003, 10:18:20) on...
by: Olaf Meding | last post by:
When does the makepy utility generate a .py file and when a directory? And what decided if a directory or a file is generated? What is the difference between a file and a directory (both named...
by: nvhengr | last post by:
Has anyone seen this? When I run the COM Makepy utility and choose Microsoft Excel 9.0 Object Library (1.3), I get an application error message: PythonWin: Pythonwin.exe - Application Error...
by: Alexander Eisenhuth | last post by:
Hello together, My system: ActivePython 2.4.1 Windows XP I write a COM Server in VC++ 6.0 using ATL. So far so good. While I develop I got sometimes strange behaviour with makepy utility....
by: gregarican | last post by:
Using Pythonwin's COM Makepy utility I created a COM wrapper around an OCX file that's used to communicate with a magstripe card reader. The wrapper was created without incident and I can invoke...
by: suzhi18 | last post by:
Hallo, I've a problem getting makepy running. When I start the tool on my machine with doubleclick everything is fine. But when I try this in my Code: makepy.py -i "Microsoft Excel 11.0...
by: gundlach | last post by:
Hi! I've just written a Python speech-recognition module (http:// pyspeech.googlecode.com). It provides a clean and simple interface to the Microsoft Speech SDK using COM wrapper classes...
by: Trent Mick | last post by:
I'm happy to announce that ActivePython is now available for download from: http://www.activestate.com/Products/activepython/ ActivePython is based on Python 2.6.0. What is...
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: lllomh | last post by:
How does React native implement an English player?
by: Mushico | last post by:
How to calculate date of retirement from date of birth
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.