[PATCH] D63254: [lit] Fix UnicodeEncodeError when test commands contain non-ASCII chars

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 11:36:33 PDT 2019


mgorny marked an inline comment as done.
mgorny added inline comments.


================
Comment at: llvm/utils/lit/lit/TestRunner.py:1139
+        mode += 'b'  # Avoid CRLFs when writing bash scripts.
+    elif sys.version_info > (3,0):
+        open_kwargs['encoding'] = 'utf-8'
----------------
rnk wrote:
> I was thinking perhaps this should be `if` not `elif`, but I've run the ELF LLD test suite successfully on Windows with Python 3 and it works fine as is.
This is `elif` because encoding only applies when mode is `w` and not `wb`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63254/new/

https://reviews.llvm.org/D63254





More information about the llvm-commits mailing list