Hi, Win32com generates Python-files for use with com interfaces, using the make-py.py utility. The generated files are OK with Python2.3.5 The generated files crash the Python interpreter with Python 2.4 Under Python 2.4.1c1, They give a syntax error!? The files unfortunately are very big, nearly 2Mb each, although they compress very well (270Kb). The errors given are for one file: "D:\Python24\lib\site-packages\win32com\gen_py\00020905-0000-0000-C000-000000000046x0x8x1.py", line 3025 "StyleName": (3, 2, (8, 0), (), "StyleName", None), "Value": (0, 2, (8, 0), (), "Value", None), ^ SyntaxError: invalid syntax (The marker is in the middle of 'None') And for the other file: File "D:\Python24\lib\site-packages\win32com\gen_py\00020813-0000-0000-C000-000000000046x0x1x3.py", line 2591 return ret ^ SyntaxError: invalid syntax At least the interpreter no longer crashes, but I'm very surprised that this gives syntax errors when the exact same files do compile with Python 2.3.5 (To be sure, I generated the files using Python2.3.5, then copied them to the 2.4.1c1 installation, and then tried to have them compiled.) Eyeballing the files, I can definately not see any syntax errors. Anyone who can help or offer any suggestions? Please CC me on any replies b/c I'm not subscribed to the list. regards, --Tim
Leeuw van der, Tim wrote:
The generated files crash the Python interpreter with Python 2.4
Under Python 2.4.1c1, They give a syntax error!?
Even though the bug was fixed in pywin, it is interesting to observe that Mark's analysis says "Cause of the underling crash is that the generated .py causes an overflow as the byte-code is generated - something in 2.4 bloated the byte-code for these modules." There also seems to be an interaction with PEP 263, for which patch 1101726 might provide a solution. So I think this needs to be investigated; please submit a bug report, including the Python file that causes the crash. Regards, Martin
participants (2)
-
"Martin v. Löwis"
-
Leeuw van der, Tim