Skip to content

Commit a5936ad

Browse files
bpo-1294959: Try to clarify the meaning of platlibdir (GH-20332)
Try to make the meaning of platlibdir clear. The previous wording could be misinterpreted to suggest that it will be used to find all shared libraries on the system, and not just Python extensions. Furthermore, it was unclear whether it affects third-party (site-packages) extensions or not. The new wording tries to make its dual purpose clear, and provide the additional example of extensions in site-packages. (cherry picked from commit 242d956) Co-authored-by: Michał Górny <[email protected]>
1 parent 6a47864 commit a5936ad

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Doc/library/sys.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,8 +1141,7 @@ always available.
11411141
.. data:: platlibdir
11421142

11431143
Name of the platform-specific library directory. It is used to build the
1144-
path of platform-specific dynamic libraries and the path of the standard
1145-
library.
1144+
path of standard library and the paths of installed extension modules.
11461145

11471146
It is equal to ``"lib"`` on most platforms. On Fedora and SuSE, it is equal
11481147
to ``"lib64"`` on 64-bit platforms which gives the following ``sys.path``
@@ -1153,8 +1152,10 @@ always available.
11531152
* ``/usr/lib64/pythonX.Y/lib-dynload/``:
11541153
C extension modules of the standard library (like the :mod:`errno` module,
11551154
the exact filename is platform specific)
1156-
* ``/usr/lib/pythonX.Y/site-packages`` (always use ``lib``, not
1155+
* ``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not
11571156
:data:`sys.platlibdir`): Third-party modules
1157+
* ``/usr/lib64/pythonX.Y/site-packages/``:
1158+
C extension modules of third-party packages
11581159

11591160
.. versionadded:: 3.9
11601161

Doc/whatsnew/3.9.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,9 @@ sys
552552
---
553553

554554
Add a new :attr:`sys.platlibdir` attribute: name of the platform-specific
555-
library directory. It is used to build the path of platform-specific dynamic
556-
libraries and the path of the standard library. It is equal to ``"lib"`` on
557-
most platforms. On Fedora and SuSE, it is equal to ``"lib64"`` on 64-bit
558-
platforms.
555+
library directory. It is used to build the path of standard library and the
556+
paths of installed extension modules. It is equal to ``"lib"`` on most
557+
platforms. On Fedora and SuSE, it is equal to ``"lib64"`` on 64-bit platforms.
559558
(Contributed by Jan Matějek, Matěj Cepl, Charalampos Stratakis and Victor Stinner in :issue:`1294959`.)
560559

561560
Previously, :attr:`sys.stderr` was block-buffered when non-interactive. Now

Misc/NEWS.d/3.9.0a5.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ modules are built.
990990
Add ``--with-platlibdir`` option to the configure script: name of the
991991
platform-specific library directory, stored in the new
992992
:attr:`sys.platlibdir` attribute. It is used to build the path of
993-
platform-specific dynamic libraries and the path of the standard library. It
993+
platform-specific extension modules and the path of the standard library. It
994994
is equal to ``"lib"`` on most platforms. On Fedora and SuSE, it is equal to
995995
``"lib64"`` on 64-bit platforms. Patch by Jan Matějek, Matěj Cepl,
996996
Charalampos Stratakis and Victor Stinner.

0 commit comments

Comments
 (0)