[Lldb-commits] [PATCH] D76955: [lldb/Test] Decode stdout and stderr in case it contains UTF-8

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 20 15:46:06 PDT 2020


JDevlieghere added a comment.

Lit's `to_string` will just return the string when it's a `str` instance, which in Python can still contain UTF-8 characters:

  >>> foo = "😀"
  >>> isinstance(foo, str)
  True
  >>> foo.encode('utf-8')
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 0: ordinal not in range(128)


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

https://reviews.llvm.org/D76955





More information about the lldb-commits mailing list