[python-win32] Strange order of OnEnter/LeaveScript site methods in application hosting Python active scripting engine

Milan Kaše milan.kase at gmail.com
Wed May 29 19:34:16 CEST 2013


Hello,
a user of our application which can host various active scripting engines
reported problems when using the application together with Python active
scripting engine. I traced the problem down to the order in which the
engine calls the site's OnEnterScript/OnLeaveScript methods.

The usual scenario with other engines (including MS JScript and VBScript)
is:
1. OnEnterScript
2. ...executing script...
3. OnLeaveScript

However with Python engine, after calling
IActiveScript.SetScriptState(SCRIPTSTATE_CONNECTED) the scenario is
following:
1. OnEnterScript
2. OnLeaveScript
3. OnEnterScript
4. ...executing script...
5. OnLeaveScript

One would expect either the first scenario or in case the events are raised
multiple times, then the calls should be nested (as stated in MSDN,
http://msdn.microsoft.com/en-us/library/9c1cww48(v=vs.94).aspx). Is the
Python's way of calling these methods intentional or is it a bug?

Thanks,
Milan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20130529/c6946efc/attachment.html>


More information about the python-win32 mailing list