diff options
author | Georg Brandl <georg@python.org> | 2009-02-05 10:37:07 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-02-05 10:37:07 (GMT) |
commit | acc802b1711da0fb7fd9cd04e3666c85965b7bb4 (patch) | |
tree | e21fae71d96698f1664662fb89b62fd9cd813287 /Doc | |
parent | 174fbe7742e55a040682bed80c872119d0b0da53 (diff) | |
download | cpython-acc802b1711da0fb7fd9cd04e3666c85965b7bb4.zip cpython-acc802b1711da0fb7fd9cd04e3666c85965b7bb4.tar.gz cpython-acc802b1711da0fb7fd9cd04e3666c85965b7bb4.tar.bz2 |
#5144: document that PySys_SetArgv prepends the script directory (or the empty string) to sys.path.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/init.rst | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index 4c3540b..327aed7 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -353,13 +353,17 @@ Initialization, Finalization, and Threads single: Py_FatalError() single: argv (in module sys) - Set ``sys.argv`` based on *argc* and *argv*. These parameters are similar to - those passed to the program's :cfunc:`main` function with the difference that - the first entry should refer to the script file to be executed rather than the - executable hosting the Python interpreter. If there isn't a script that will be - run, the first entry in *argv* can be an empty string. If this function fails - to initialize ``sys.argv``, a fatal condition is signalled using - :cfunc:`Py_FatalError`. + Set :data:`sys.argv` based on *argc* and *argv*. These parameters are + similar to those passed to the program's :cfunc:`main` function with the + difference that the first entry should refer to the script file to be + executed rather than the executable hosting the Python interpreter. If there + isn't a script that will be run, the first entry in *argv* can be an empty + string. If this function fails to initialize :data:`sys.argv`, a fatal + condition is signalled using :cfunc:`Py_FatalError`. + + This function also prepends the executed script's path to :data:`sys.path`. + If no script is executed (in the case of calling ``python -c`` or just the + interactive interpreter), the empty string is used instead. .. XXX impl. doesn't seem consistent in allowing 0/NULL for the params; check w/ Guido. |