Title: Document behavior when CDLL is called with None as an argument on POSIX systems
Type: enhancement Stage: needs patch
Components: ctypes, Documentation Versions: Python 3.6, Python 3.5, Python 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Jeffrey Esquivel Sibaja, docs@python
Priority: normal Keywords:

Created on 2016-06-16 04:38 by Jeffrey Esquivel Sibaja, last changed 2016-06-16 04:48 by martin.panter.

Messages (1)
msg268641 - (view) Author: Jeffrey Esquivel Sibaja (Jeffrey Esquivel Sibaja) Date: 2016-06-16 04:38
On POSIX systems, when CDLL is called with None as an argument, it will call the system's dlopen() library function with NULL as it's filename parameter, causing the following behavior (as documented on dlopen's manpage):

"If filename is NULL, then the returned handle is for the main  program.  When given to dlsym(), this handle causes a search for a symbol in the main program, followed by all shared objects loaded at program startup, and then all shared objects loaded by dlopen() with the flag RTLD_GLOBAL."

But right now, this behavior is not explicitly documented anywhere which means users need to read ctypes' source code to find out if this would work.
Date User Action Args
2016-06-16 04:48:22martin.pantersetstage: needs patch
2016-06-16 04:38:10Jeffrey Esquivel Sibajacreate