Avoid crashes on Python 2.4 by defaulting to bForDemand=True
- ie, each typelib actually creates a "skeleton" Python
package, and populates the package as each interface is
requested.
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Python still crashes when you invoke one of the methods
whose generated code caused the original crash. Looks to be
related to this bug in the tokenizer:
www.python.org/sf/1089395
It hits an assertion failure on lines longer than 512.
For a workaround, remove the mbcs encoding tag in genpy.py
and makepy works correctly even with bForDemand=0.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=49828
I'm having a similar problem with Excel 2002 in Python 2.4.
The script:
#>
from win32com.client import gencache
gencache.EnsureModule('{00020813-0000-0000-C000-000000000046}',
0, 1, 3, bForDemand=1)
import win32com.client
ExcelApp=win32com.client.Dispatch("Excel.Application")
#<
Causes a access violation in python
AppName: python.exe AppVer: 0.0.0.0 ModName: ntdll.dll
ModVer: 5.1.2600.1217 Offset: 00033905
Logged In: YES
user_id=14198
gencache.py (1.30)
makepy.py (1.19)
From that checkin message:
Avoid crashes on Python 2.4 by defaulting to bForDemand=True
- ie, each typelib actually creates a "skeleton" Python
package, and populates the package as each interface is
requested.
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.
Logged In: YES
user_id=771074
Python still crashes when you invoke one of the methods
whose generated code caused the original crash. Looks to be
related to this bug in the tokenizer:
www.python.org/sf/1089395
It hits an assertion failure on lines longer than 512.
For a workaround, remove the mbcs encoding tag in genpy.py
and makepy works correctly even with bForDemand=0.
Logged In: YES
user_id=14198
Thanks Roger - I'll dig a little deeper on this.
Logged In: YES
user_id=292730
Just wanted to note than I also see this crash, and that
commenting out the mbcs encoding line in genpy.py seems to
allow it work for me as well.
Logged In: YES
user_id=14198
This has been fixed in CVS by avoiding the generation of
huge lines.