[lldb] Explicitly open file to write with utf-8 encoding in crashlog.py
authorAugusto Noronha <augusto2112@me.com>
Wed, 26 Oct 2022 21:53:19 +0000 (14:53 -0700)
committerAugusto Noronha <augusto2112@me.com>
Fri, 28 Oct 2022 22:04:24 +0000 (15:04 -0700)
commitb3b517d572391d9799d1f29bddd66e2bad1acb54
tree91c9d4d8761e662f5fc97b9fdd0b81d3d680a08a
parentdd109f61597b4ed42e18a88c06da0553bfeb16a8
[lldb] Explicitly open file to write with utf-8 encoding in crashlog.py

The python "open" function will use the default encoding for the
locale (the result of "locale.getpreferredencoding()"). Explicitly set
the locale to utf-8 when opening the crashlog for writing, as there may
be non-ascii symbols in there (for example, Swift uses "τ" to indicate
generic parameters).

rdar://101402755

Differential Revision: https://reviews.llvm.org/D136798
lldb/examples/python/crashlog.py