[python-win32] (no subject)

Petr Gladkikh Petr Gladkikh" <batyi@mail.ru
Tue, 24 Dec 2002 18:03:45 +0300


Hello.

I have discovered a bug (at least I think it is a bug)
in win32com.client module. One of minimal exploits is as follows
<<<
def a():
    pass

def b():
    pass

def c():
    pass

def d():
    pass

def A():
    a = win32com.client.Dispatch("SourceSafe")

def B():
    b = win32com.client.Dispatch("MSDEV.APPLICATION")
>>>

This code causes access violation in python. (Note: with less number of procedures before "def A():" it forks normally)
Other variations of this code throw following exception:

<<<
Traceback (most recent call last):
  File "autobuild.py", line 1, in ?
    import win32com.client
  File "C:\PROGRA~1\Python22\lib\site-packages\win32com\client\__init__.py", line 12, in ?
    import dynamic, gencache, pythoncom
  File "C:\PROGRA~1\Python22\lib\site-packages\win32com\client\dynamic.py", line 22, in ?
    import pythoncom
  File "C:\PROGRA~1\Python22\lib\site-packages\pythoncom.py", line 18, in ?
    __import("pythoncom")
  File "C:\PROGRA~1\Python22\lib\site-packages\pythoncom.py", line 10, in __import
    h = win32api.LoadLibrary(filename)
pywintypes.error: (998, 'LoadLibrary', 'Invalid access to memory location.')
>>>

Do anyone know what is the problem?

Thanks for your attention :)
    Petr