PEP 517: Specify UTF-8 for captured output (#264)

This commit is contained in:
Thomas Kluyver 2017-05-29 02:23:39 +01:00 committed by Nick Coghlan
parent 4aaf8e6a96
commit 49b693c46a
1 changed files with 9 additions and 0 deletions

View File

@ -262,6 +262,15 @@ tree, and MAY print arbitrary informational text on stdout and
stderr. They MUST NOT read from stdin, and the build frontend MAY stderr. They MUST NOT read from stdin, and the build frontend MAY
close stdin before invoking the hooks. close stdin before invoking the hooks.
The build frontend may capture stdout and/or stderr from the backend. If the
backend detects that an output stream is not a terminal/console (e.g.
``not sys.stdout.isatty()``), it SHOULD ensure that any output it writes to that
stream is UTF-8 encoded. The build frontend MUST NOT fail if captured output is
not valid UTF-8, but it MAY not preserve all the information in that case (e.g.
it may decode using the *replace* error handler in Python). If the output stream
is a terminal, the build backend is responsible for presenting its output
accurately, as for any program running in a terminal.
If a hook raises an exception, or causes the process to terminate, If a hook raises an exception, or causes the process to terminate,
then this indicates an error. then this indicates an error.