summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-10 08:53:09 (GMT)
committerGitHub <noreply@github.com>2020-03-10 08:53:09 (GMT)
commit8510f430781118d9b603c3a2f06945d6ebc5fe42 (patch)
tree511cb42b478dd031ff36297a5e0c78b27a4e77a2 /Doc
parent700cb587303461d5a96456c56902cfdd8ad50e2d (diff)
downloadcpython-8510f430781118d9b603c3a2f06945d6ebc5fe42.zip
cpython-8510f430781118d9b603c3a2f06945d6ebc5fe42.tar.gz
cpython-8510f430781118d9b603c3a2f06945d6ebc5fe42.tar.bz2
bpo-1294959: Add sys.platlibdir attribute (GH-18381)
Add --with-platlibdir option to the configure script: name of the platform-specific library directory, stored in the new sys.platlitdir attribute. It is used to build the path of platform-specific dynamic libraries and the path of the standard library. It is equal to "lib" on most platforms. On Fedora and SuSE, it is equal to "lib64" on 64-bit systems. Co-Authored-By: Jan Matějek <jmatejek@suse.com> Co-Authored-By: Matěj Cepl <mcepl@cepl.eu> Co-Authored-By: Charalampos Stratakis <cstratak@redhat.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/sys.rst21
-rw-r--r--Doc/whatsnew/3.9.rst16
2 files changed, 37 insertions, 0 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index f67bf63..98f63fb 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -1138,6 +1138,27 @@ always available.
system's identity.
+.. data:: platlibdir
+
+ Name of the platform-specific library directory. It is used to build the
+ path of platform-specific dynamic libraries and the path of the standard
+ library.
+
+ It is equal to ``"lib"`` on most platforms. On Fedora and SuSE, it is equal
+ to ``"lib64"`` on 64-bit platforms which gives the following ``sys.path``
+ paths (where ``X.Y`` is the Python ``major.minor`` version):
+
+ * ``/usr/lib64/pythonX.Y/``:
+ Standard library (like ``os.py`` of the :mod:`os` module)
+ * ``/usr/lib64/pythonX.Y/lib-dynload/``:
+ C extension modules of the standard library (like the :mod:`errno` module,
+ the exact filename is platform specific)
+ * ``/usr/lib/pythonX.Y/site-packages`` (always use ``lib``, not
+ :data:`sys.platlibdir`): Third-party modules
+
+ .. versionadded:: 3.9
+
+
.. data:: prefix
A string giving the site-specific directory prefix where the platform
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index c232805..9056289 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -353,6 +353,17 @@ finalization crashed with a Python fatal error if a daemon thread was still
running.
(Contributed by Victor Stinner in :issue:`37266`.)
+sys
+---
+
+Add a new :attr:`sys.platlitdir` attribute: name of the platform-specific
+library directory. It is used to build the path of platform-specific dynamic
+libraries and the path of the standard library. It is equal to ``"lib"`` on
+most platforms. On Fedora and SuSE, it is equal to ``"lib64"`` on 64-bit
+platforms.
+(Contributed by Jan Matějek, Matěj Cepl, Charalampos Stratakis and Victor Stinner in :issue:`1294959`.)
+
+
typing
------
@@ -390,6 +401,11 @@ Optimizations
Build and C API Changes
=======================
+* Add ``--with-platlibdir`` option to the ``configure`` script: name of the
+ platform-specific library directory, stored in the new :attr:`sys.platlitdir`
+ attribute. See :attr:`sys.platlibdir` attribute for more information.
+ (Contributed by Jan Matějek, Matěj Cepl, Charalampos Stratakis and Victor Stinner in :issue:`1294959`.)
+
* Add a new public :c:func:`PyObject_CallNoArgs` function to the C API, which
calls a callable Python object without any arguments. It is the most efficient
way to call a callable Python object without any argument.