Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,14 @@ way is to instantiate :py:class:`CDLL` or one of its subclasses:
they are not added automatically.
See :ref:`ctypes-finding-shared-libraries` for more information.

On macOS, a *name* that is not an absolute path may only be searched
for in system locations such as :file:`/usr/lib`. Libraries and
frameworks in folders like :file:`/usr/local/lib`, :file:`~/lib` or
:file:`~/Library/Frameworks` are then not found, so pass the full path.
Setting :envvar:`!DYLD_LIBRARY_PATH` or :envvar:`!DYLD_FRAMEWORK_PATH`
before starting Python adds search locations, but macOS ignores these
variables for some executables.
Comment on lines +1587 to +1593

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Petr that we should be more explicit about the fact that ctypes.CDLL calls dlopen, and thus inherits any quirks from the system-level function. Once we've done that, I'm not sure it's necessary to document all the individual quirks of what a given OS does.


On non-Windows systems, *name* can be ``None``. In this case,
:c:func:`!dlopen` is called with ``NULL``, which opens the main program
as a "library".
Expand Down

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs-only changes don't need changelog entries, so please remove this.

(This blurb section is badly named, sorry! It's meant for changes to the build script and such.)

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Document that :class:`ctypes.CDLL` on macOS may not find libraries in
:file:`/usr/local/lib` or user folders unless given a full path.
Loading