This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steve.dower
Recipients eryksun, mhammond, paul.moore, steve.dower, tim.golden, zach.ware
Date 2016-06-29.18:19:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1467224377.99.0.571630822652.issue27417@psf.upfronthosting.co.za>
In-reply-to
Content
I'd like to enable calling CoInitializeEx on Python startup for 3.6 (and into the future). See https://msdn.microsoft.com/en-us/library/windows/desktop/ms695279.aspx

This would enable us to use more advanced Windows features within Python that require COM, such as better integration with the shell or features such as AMSI (issue26137, https://msdn.microsoft.com/en-us/library/windows/desktop/dn889587.aspx). The fact that AMSI is a security feature makes it important that it be enabled by default and not be able to be disabled.

Calling CoInitializeEx has no impact on code that isn't already calling it, however, since it can only be called once per thread and you can't change the apartment type, it could break existing code that calls it directly (but only if it tries to use a different apartment type).

My proposal is to call CoInitializeEx(NULL, COINIT_MULTITHREADED) by default, with "-X:STA" to call CoInitializeEx(NULL, COINIT_APARTMENTTHREADED) instead. (Single Threaded Apartment is the commonly used acronym for COINIT_APARTMENTTHREADED.) This forces the decision onto the user rather than letting libraries do it, but since libraries may have conflicting requirements, this hardly makes things worse. It also means we can rely on COM being enabled for any features we may want to enable within Python.

I've nosied people who I expect/hope to have an opinion, so let me know what you think.
History
Date User Action Args
2016-06-29 18:19:38steve.dowersetrecipients: + steve.dower, mhammond, paul.moore, tim.golden, zach.ware, eryksun
2016-06-29 18:19:37steve.dowersetmessageid: <1467224377.99.0.571630822652.issue27417@psf.upfronthosting.co.za>
2016-06-29 18:19:37steve.dowerlinkissue27417 messages
2016-06-29 18:19:37steve.dowercreate