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.
Created on 2008年05月07日 16:47 by janssen, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| unnamed | janssen, 2008年05月21日 20:03 | |||
| Messages (6) | |||
|---|---|---|---|
| msg66362 - (view) | Author: Bill Janssen (janssen) * (Python committer) | Date: 2008年05月07日 16:47 | |
On OS X, dynamically loadable libraries come in several flavors: .bundle (or, often, .so) a standard dynamically loadable module; .dylib, a dynamically loadable module that is also a library that can be linked against like a .a file; .framework, a collection of modules similar to a Python package. find_library() currently looks for .dylib and .framework libraries, but not for .bundle or .so libraries. |
|||
| msg67162 - (view) | Author: Thomas Heller (theller) * (Python committer) | Date: 2008年05月21日 17:30 | |
The OS X find_library code was not written by me, the code was ripped from Bob Ippolitos macholib. Can some OS X expert please look into this? Shamelessly assigning to Ronald - feel free to unassign if you have no time. |
|||
| msg67165 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2008年05月21日 18:15 | |
At first glance the current behaviour is correct: 1) Bundles aren't shared libraries, but plugin code. It should be possible to load bundles, but I don't agree that find_library should try to locate them, specially given this bit in the documentation: [quote] The purpose of the find_library function is to locate a library in a way similar to what the compiler does (on platforms with several versions of a shared library the most recent should be loaded), while the ctypes library loaders act like when a program is run, and call the runtime loader directly. [/quote] 2) There is no prescribed suffix for bundles. Python uses .so and some other packages use .bundle, but that's just a convention that a specific software product chooses. |
|||
| msg67166 - (view) | Author: Thomas Heller (theller) * (Python committer) | Date: 2008年05月21日 18:38 | |
Thanks, Ronald. Sounds like this bug could be closed then. Bill, if you want a library search function with different semantics, I suggest you open a feature request, describe the sematics that should be used and (ideally) provide a patch. |
|||
| msg67172 - (view) | Author: Bill Janssen (janssen) * (Python committer) | Date: 2008年05月21日 20:03 | |
I thought you might say that :-). No, I'm good with this resolution. If I provide a patch, it will be for the LD_LIBRARY_PATH problem. Though -- I think there's an interesting question about what the purpose of "find_library()" actually is, as opposed to what it's current implementation is. I disagree with Ronald's strict reading of the documentation. I think it should emulate the behavior of the dynamic linker, not the C compiler. That is, it should look for the libraries as "ld.so" (or its platform equivalent) would, because the purpose of finding them is to load them with CDLL. This behavior is different from what the compiler does. I also think find_library() should just be moved into the ctypes library, not dangling off by itself in the otherwise unused util sub-module. Bill On Wed, May 21, 2008 at 11:39 AM, Thomas Heller <report@bugs.python.org> wrote: > > Thomas Heller <theller@ctypes.org> added the comment: > > Thanks, Ronald. Sounds like this bug could be closed then. > > Bill, if you want a library search function with different semantics, > I suggest you open a feature request, describe the sematics that > should be used and (ideally) provide a patch. > > __________________________________ > Tracker <report@bugs.python.org> > <http://bugs.python.org/issue2783> > __________________________________ > |
|||
| msg67173 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2008年05月21日 20:13 | |
Bill, even if find_library were to emulate the runtime linker it shouldn't
find objects of type MH_BUNDLE.
Those are not shared libraries, but explicitly meant to be used as code
resources for plugins. find_library should not return bz2.so when your
working directory happens to be ${sys.prefix}/lib/python*/lib-dynload and
you call find_library('bz2').
BTW. What is your usecase?
|
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:34 | admin | set | github: 47032 |
| 2008年05月21日 20:38:15 | benjamin.peterson | set | status: open -> closed |
| 2008年05月21日 20:13:24 | ronaldoussoren | set | resolution: not a bug messages: + msg67173 |
| 2008年05月21日 20:04:03 | janssen | set | files:
+ unnamed messages: + msg67172 |
| 2008年05月21日 18:38:57 | theller | set | messages: + msg67166 |
| 2008年05月21日 18:15:41 | ronaldoussoren | set | messages: + msg67165 |
| 2008年05月21日 17:30:02 | theller | set | assignee: theller -> ronaldoussoren messages: + msg67162 nosy: + ronaldoussoren |
| 2008年05月07日 16:47:14 | janssen | create | |