New submission from Albert Zeyer:

On MacOSX, when you build an ARC-enabled Dylib with backward compatibility for 
e.g. MacOSX 10.6, some unresolved functions like 
`_objc_retainAutoreleaseReturnValue` might end up in your Dylib.

Some reference about the issue:
1. http://stackoverflow.com/q/21119425/133374>.
2. http://osdir.com/ml/python.ctypes/2006-10/msg00029.html
3. https://groups.google.com/forum/#!topic/comp.lang.python/DKmNGwyLl3w

Thus, RTLD_NOW is often not an option for MacOSX.

This affects mostly `py_dl_open()` from ctypes.
But it is also related how you set `dlopenflags` in `PyInterpreterState_New()`.

I suggest to make RTLD_LAZY the default on MacOSX (or is there a good reason 
not to do?).
Also, ctypes should have options for both RTLD_NOW and RTLD_LAZY so that both 
can be used.

This is also consistent with the behavior of the [dl 
module](http://docs.python.org/2/library/dl.html).

----------
components: ctypes
messages: 208226
nosy: Albert.Zeyer
priority: normal
severity: normal
status: open
title: ctypes._dlopen should not force RTLD_NOW
versions: Python 2.7

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

Reply via email to