bpo-23427: Add sys.orig_argv attribute (GH-20729)

Add sys.orig_argv attribute: the list of the original command line
arguments passed to the Python executable.

Rename also PyConfig._orig_argv to PyConfig.orig_argv and
document it.
This commit is contained in:
Victor Stinner 2020-06-30 00:49:03 +02:00 committed by GitHub
parent 2fb5f038f2
commit dd8a93e23b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 104 additions and 35 deletions

View file

@ -66,6 +66,8 @@ always available.
To loop over the standard input, or the list of files given on the
command line, see the :mod:`fileinput` module.
See also :data:`sys.orig_argv`.
.. note::
On Unix, command line arguments are passed by bytes from OS. Python decodes
them with filesystem encoding and "surrogateescape" error handler.
@ -1037,6 +1039,16 @@ always available.
deleting essential items from the dictionary may cause Python to fail.
.. data:: orig_argv
The list of the original command line arguments passed to the Python
executable.
See also :data:`sys.argv`.
.. versionadded:: 3.10
.. data:: path
.. index:: triple: module; search; path