mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
bpo-17110: doc: add note how to get bytes from sys.argv (GH-12602)
This commit is contained in:
parent
7444daada1
commit
38f4e468d4
1 changed files with 6 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue