[docs] [issue18017] ctypes.PyDLL documentation
report at bugs.python.org
Mon May 20 02:38:39 CEST 2013
New submission from Marc Brünink:
The documentation for is not very clear regarding the usage of CDLL and PyDLL. Especially it is not obvious that you should use PyDLL whenever you call any function of the Python/C API. Since calling a Python/C API function without owning the GIL will most likely cause latent segfaults, I think it warrants a warning box in section 22.214.171.124 and maybe also somewhere prominent in http://docs.python.org/dev/c-api/intro.html.
For section 126.96.36.199 I would put a box next the decription of CDLL saying something like: "The Python GIL is released before a function call. It is not safe to call any Pyhon/C API function within the loaded library without acquiring the GIL first. Thus, if the loaded library calls functions of the Python/C API, for example in case it creates and returns a new Python object, and does not manually acquire and release the GIL, use PyDLL instead."
assignee: docs at python
nosy: Marc.Brünink, docs at python
title: ctypes.PyDLL documentation
versions: Python 3.5
Python tracker <report at bugs.python.org>
More information about the docs