Use `bytes`, not `str`, to return C++ strings to Python.
authorChris Jones <cjfj@deepmind.com>
Thu, 13 Apr 2023 15:05:26 +0000 (17:05 +0200)
committerAlex Zinenko <zinenko@google.com>
Thu, 13 Apr 2023 15:09:19 +0000 (17:09 +0200)
commit62bf6c2e1083b8ddc698f5c8b99d6c3614c9b56a
tree336f3277f8e73efcd67dbf4aa60ec742a10d0350
parenta5f2e60a913bdd33a5a790d1459e8517d4d35677
Use `bytes`, not `str`, to return C++ strings to Python.

`str` must be valid UTF-8, which is not guaranteed for C++ strings.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D147818
mlir/lib/Bindings/Python/IRAttributes.cpp
mlir/test/python/ir/attributes.py
mlir/test/python/ir/operation.py