[issue17213] ctypes loads wrong version of C runtime, leading to error message box from system

2016-07-08 Thread Keno Fischer

Keno Fischer added the comment:

pyzmq has a similar issue. I believe one solution would be to call
`_Py_ActivateActCtx` in ctypes' load_library, i.e. do
```
#if HAVE_SXS
ULONG_PTR cookie = _Py_ActivateActCtx();
#endif
hMod = LoadLibraryW(name);
#if HAVE_SXS
_Py_DeactivateActCtx(cookie);
#endif
```
in that function. I don't know enough about python or ctypes to say whether 
this patch works as is (_Py_ActivateActCtx seems to be an internal function, 
not sure if ctypes has access to that).

--
nosy: +Keno Fischer

___
Python tracker 
<http://bugs.python.org/issue17213>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17213] ctypes loads wrong version of C runtime, leading to error message box from system

2016-07-09 Thread Keno Fischer

Keno Fischer added the comment:

Yes, you are correct about it being only an issue in the embedding context.
I agree that it might not be a good idea to do do this for every library, but I 
wanted to revive the discussion since this kind of thing seems like something 
that comes up frequently when people embed python. Thanks for the reference to 
the other thread. A solution that allows the activation context to be specified 
would be great.

--

___
Python tracker 
<http://bugs.python.org/issue17213>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com