[PATCH] D68938: [LNT] Python 3 support: subprocess IO as text

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 03:22:32 PDT 2019


thopre created this revision.
thopre added reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls.
thopre added a parent revision: D68922: [LNT] Python 3 support: read machine deletion page as text.

In Python 3, subprocess stdin, stdout and stderr are in binary mode by
default. Trying to print or parse those as text as is done thoughought
in LNT then causes byte/str errors. This commits sets the
universal_newlines parameter to True when invoking subprocess methods
involving input or output to request those to be in text mode. It also
adapt _check_output to work whether universal_newlines is set to True in
the caller or not. Finally, it cleans up 2 cases subprocess method call
where the output file objects are stored in a variable but not used.


https://reviews.llvm.org/D68938

Files:
  lnt/server/db/rules/rule_update_profile_stats.py
  lnt/testing/util/commands.py
  lnt/tests/compile.py
  lnt/tests/nt.py
  lnt/tests/test_suite.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68938.224827.patch
Type: text/x-patch
Size: 8703 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191014/b559912f/attachment.bin>


More information about the llvm-commits mailing list