[python-win32] Memory access violation using pywin32 as WSH

Mark Hammond mhammond at skippinet.com.au
Tue Nov 29 18:23:11 EST 2022


On 30/11/2022 9:09 am, Bob Kline wrote:
>
> So at least part of that puzzle is cleared up, though it's still 
> somewhat unsettling that only seven calls to ScriptItem.Close() are 
> made, regardless of how many ScriptItem objects have been instantiated 
> during a session.


The close method is 
https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.debugger.interop.iactivescript.close?view=visualstudiosdk-2019, 
so it's the responsibility of the host to call that. I agree it's a bit 
of a red flag, and may point to confusion in the host about object 
lifetimes, which could certainly end up causing what you are seeing. 
It's worth pointing out that any "obvious" bug in pywin32 here would 
probably be able to be reproduced in, and reported by, the various other 
hosts, including cscript.exe and wscript.exe (which themselves are just 
active script hosts, just like your problematic host)

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/python-win32/attachments/20221130/a7c81ac1/attachment-0001.html>


More information about the python-win32 mailing list