From 678c8ca92f3bff7384d3de517d02c26a9f92b3d6 Mon Sep 17 00:00:00 2001 From: Addison Snelling Date: Wed, 12 Aug 2026 20:16:47 +0000 Subject: [PATCH 1/2] gh-90982: Document prefixes argument on site.getsitepackages (GH-31546) (cherry picked from commit bc31217fe432b5ede1485bec2b62b2c67a48eee4) Co-authored-by: Addison Snelling --- Doc/library/site.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Doc/library/site.rst b/Doc/library/site.rst index f8b51bc86eb9602..57b1dfdb6830c2b 100644 --- a/Doc/library/site.rst +++ b/Doc/library/site.rst @@ -233,12 +233,19 @@ Module contents used in :mod:`sitecustomize` or :mod:`usercustomize` (see above). -.. function:: getsitepackages() +.. function:: getsitepackages(prefixes=None) Return a list containing all global site-packages directories. + For each directory present in *prefixes* (or :data:`PREFIXES` if *prefixes* + is ``None``), this function will find its site-packages subdirectory + depending on the system environment, and will return a list of full paths. + .. versionadded:: 3.2 + .. versionchanged:: 3.3 + Add the optional *prefixes* argument. + .. function:: getuserbase() From b37bc1d562e152717329117f34ab7c09a7a8b6dd Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 13 Aug 2026 08:42:53 +0300 Subject: [PATCH 2/2] gh-90982: Say "Added the optional *prefixes* parameter" Co-Authored-By: Claude Opus 5 (1M context) --- Doc/library/site.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/site.rst b/Doc/library/site.rst index 57b1dfdb6830c2b..d49dee2876d87de 100644 --- a/Doc/library/site.rst +++ b/Doc/library/site.rst @@ -244,7 +244,7 @@ Module contents .. versionadded:: 3.2 .. versionchanged:: 3.3 - Add the optional *prefixes* argument. + Added the optional *prefixes* parameter. .. function:: getuserbase()