[python-win32] Python crash

Petr Gladkikh Petr Gladkikh" <batyi@mail.ru
Wed, 25 Dec 2002 09:03:11 +0300


Hello.

It seems that it is rare problem. But to be more precise I'd like to point out that crash is happen excactly when executing this code. That is I have file a.py containing excactly following 7 lines (and only these lines):
import win32com.client
def a(): pass
def b(): pass
def c(): pass
def d(): pass
def A(): a = win32com.client.Dispatch("")
def B(): a = win32com.client.Dispatch("")

Then at DOS prompt I type 
python.exe a.py

then python interpreter chrashes due to access violation.
Had I removed any single line nothing strange happens. My guess is that there are either some binary incompatibilities either it is (again :) bug in the module (more precise, in module initialisation).
I have installed Python-2.2.2 and win32all-150 on Win2000.

Following script (thanks to advise of "Jim Vickroy" <Jim.Vickroy@noaa.gov>):
def a(): pass
def b(): pass
def c(): pass
def d(): pass
import win32com.client
def A(): a = win32com.client.Dispatch("")
def B(): a = win32com.client.Dispatch("")

Works fine on my machine too. But in the best of the worlds reason of this behaviour should be located. (I don't like workarounds :)

Petr.