mirror of https://github.com/python/cpython
bpo-17110: doc: add note how to get bytes from sys.argv (GH-12602)
This commit is contained in:
parent
7444daada1
commit
38f4e468d4
|
@ -30,6 +30,12 @@ always available.
|
|||
To loop over the standard input, or the list of files given on the
|
||||
command line, see the :mod:`fileinput` module.
|
||||
|
||||
.. note::
|
||||
On Unix, command line arguments are passed by bytes from OS. Python decodes
|
||||
them with filesystem encoding and "surrogateescape" error handler.
|
||||
When you need original bytes, you can get it by
|
||||
``[os.fsencode(arg) for arg in sys.argv]``.
|
||||
|
||||
|
||||
.. data:: base_exec_prefix
|
||||
|
||||
|
|
Loading…
Reference in New Issue