Paul Moore added the comment:

Hmm, this'll teach me to rely on my memory rather than checking :-)

It seems to me that core code that needs COM can use it by wrapping the code in 
CoInitializeEx(sys.coinit_flags)...CoUninitialize(). That will either work fine 
(I don't know where you got the idea that CoInitializeEx can only be called 
once per thread - AFAICT the the documentation you linked to clearly states 
that's not the case) or it will fail because someone else has initialised the 
thread with an incompatible model. Either try the other model (if you don't 
actually care) or report the issue and stop - it's the user's code that is 
relying on conflicting functions, so let the user decide how to deal with it.

Do you have a use case in mind where something like the above wouldn't work?

BTW, I agree that AMSI sounds like a very weird thing to want to add to the 
Python interpreter - maybe it might make sense to have a special build 
"checking" interpreter that could be used in appropriate circumstances, but I'd 
be very uncomfortable adding something like that to the core binary or making 
it "enabled by default and not be able to be disabled". So that's not a good 
motivating use case for me...

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27417>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to