Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f9b5840f
Commit
f9b5840f
authored
Sep 11, 2019
by
native-api
Committed by
Miss Islington (bot)
Sep 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-33944: note about the intended use of code in .pth files (GH-10131)
https://bugs.python.org/issue33944
parent
6f55b039
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
Doc/library/site.rst
Doc/library/site.rst
+13
-0
Misc/NEWS.d/next/Documentation/2018-10-26-18-10-29.bpo-33944.V1YeOA.rst
...xt/Documentation/2018-10-26-18-10-29.bpo-33944.V1YeOA.rst
+1
-0
No files found.
Doc/library/site.rst
View file @
f9b5840f
...
...
@@ -61,6 +61,19 @@ directory rather than a file. No item is added to ``sys.path`` more than
once. Blank lines and lines beginning with ``#`` are skipped. Lines starting
with ``import`` (followed by space or tab) are executed.
.. note::
An executable line in a :file:`.pth` file is run at every Python startup,
regardless of whether a particular module is actually going to be used.
Its impact should thus be kept to a minimum.
The primary intended purpose of executable lines is to make the
corresponding module(s) importable
(load 3rd-party import hooks, adjust :envvar:`PATH` etc).
Any other initialization is supposed to be done upon a module's
actual import, if and when it happens.
Limiting a code chunk to a single line is a deliberate measure
to discourage putting anything more complex here.
.. index::
single: package
triple: path; configuration; file
...
...
Misc/NEWS.d/next/Documentation/2018-10-26-18-10-29.bpo-33944.V1YeOA.rst
0 → 100644
View file @
f9b5840f
Added a note about the intended use of code in .pth files.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment