Commits

Carl Meyer committed ebe5760

Documentation and NEWS notes for issue #11591.

  • Participants
  • Parent commits 87df1d3

Comments (0)

Files changed (2)

File Doc/library/site.rst

 
 .. index:: triple: module; search; path
 
-Importing this module will append site-specific paths to the module search path.
+Importing this module will append site-specific paths to the module search
+path, unless :option:`-S` was used. In that case, this module can be safely
+imported with no automatic modifications to the module search path. To
+explicitly trigger the usual site-specific additions, call this module's
+:func:`main` function.
 
 .. index::
    pair: site-python; directory
 .. envvar:: PYTHONUSERBASE
 
 
+.. function:: main()
+
+   Adds all the standard site-specific directories to the module search
+   path. This function is called automatically when this module is imported,
+   unless the python interpreter was run with the :option:`-S` flag.
+
 .. function:: addsitedir(sitedir, known_paths=None)
 
    Adds a directory to sys.path and processes its pth files.
 Library
 -------
 
+- Issue #11591: Prevent imports from "site" from automatically adding site
+  directories to sys.path under "python -S".
+
 - Issue #10812: Add some extra posix functions to the os module.
 
 - Issue #10979: unittest stdout buffering now works with class and module