[Python-checkins] r69289 - python/trunk/Doc/c-api/init.rst

georg.brandl python-checkins at python.org
Thu Feb 5 11:37:07 CET 2009


Author: georg.brandl
Date: Thu Feb  5 11:37:07 2009
New Revision: 69289

Log:
#5144: document that PySys_SetArgv prepends the script directory (or the empty string) to sys.path.

Modified:
   python/trunk/Doc/c-api/init.rst

Modified: python/trunk/Doc/c-api/init.rst
==============================================================================
--- python/trunk/Doc/c-api/init.rst	(original)
+++ python/trunk/Doc/c-api/init.rst	Thu Feb  5 11:37:07 2009
@@ -353,13 +353,17 @@
       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.


More information about the Python-checkins mailing list