Do not touch sys.path when site is imported and python was started with -S.
Original patch by Carl Meyer, review by Brett Cannon, small doc editions by
yours truly. Fixes #11591.
diff --git a/Misc/NEWS b/Misc/NEWS
index e8a1926..363d5e9 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -81,12 +81,15 @@
Library
-------
+- Issue #11591: Prevent "import site" from modifying sys.path when python
+ was started with -S.
+
- Issue #11371: Mark getopt error messages as localizable. Patch by Filip
Gruszczyński.
- Issue #11333: Add __slots__ to collections ABCs.
-- Issue #11628: cmp_to_key generated class should use __slots__
+- Issue #11628: cmp_to_key generated class should use __slots__.
- Issue #5537: Fix time2isoz() and time2netscape() functions of
httplib.cookiejar for expiration year greater than 2038 on 32-bit systems.
diff --git a/Misc/python.man b/Misc/python.man
index 2d15d5d..53b77fc 100644
--- a/Misc/python.man
+++ b/Misc/python.man
@@ -169,7 +169,9 @@
.I site
and the site-dependent manipulations of
.I sys.path
-that it entails.
+that it entails. Also disable these manipulations if
+.I site
+is explicitly imported later.
.TP
.B \-u
Force the binary I/O layers of stdin, stdout and stderr to be unbuffered.