bpo-17110: doc: add note how to get bytes from sys.argv (GH-12602)

This commit is contained in:
Inada Naoki 2019-03-30 14:32:08 +09:00 committed by GitHub
parent 7444daada1
commit 38f4e468d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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