From 49b693c46af05cfce989508b1b0ca9bb10f5a9e1 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Mon, 29 May 2017 02:23:39 +0100 Subject: [PATCH] PEP 517: Specify UTF-8 for captured output (#264) --- pep-0517.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pep-0517.txt b/pep-0517.txt index da7a33db7..cdb2b97c5 100644 --- a/pep-0517.txt +++ b/pep-0517.txt @@ -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 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, then this indicates an error.