473,468 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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...
Generating...
Importing module
Failed to execute command:
from win32com.client import makepy;makepy.main()
Traceback (most recent call last):
File
"C:\Python24\Lib\site-packages\pythonwin\pywin\framework\toolmenu.py",
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,
info.minor)
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)
File
"C:\Python24\lib\site-packages\win32com\gen_py\00020905-0000-0000-C000-000000000046x0x8x3\__init__.py",
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 2702
After exploring the bug database I discovered that this bug has been
reported since March, and appears to derive from a bug in Python
itself.

http://bugs.activestate.com/show_bug.cgi?id=38052

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

0
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...
3
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...
1
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...
2
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...
2
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....
0
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...
4
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...
1
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...
14
by: Trent Mick | last post by:
I'm happy to announce that ActivePython 2.6.0.0 is now available for download from: http://www.activestate.com/Products/activepython/ ActivePython 2.6.0.0 is based on Python 2.6.0. What is...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.