runtimeverification / runtimeverification/llvm-backend
pybind11 raises a `UnicodeDecodeError` on non-utf bytes in terms of sort `Bytes`
@gtrepta is already working on this.
Since Jun 6, 2024.
- Dominant language
- C++
- Stars
- 43
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
Terms of sort Bytes and String are both stored in a kore_string_pattern in the AST library and treated the same way when being accessed from the bindings:
The issue here is when the contents property is accessed, pybind assumes it's a valid utf encoded string. This isn't always the case for Bytes terms, though, and an exception gets thrown in that case.
Pybind does support returning an unconverted string, so we should find out how to do that for terms that need to be treated that way.
https://pybind11.readthedocs.io/en/stable/advanced/cast/strings.html#returning-c-strings-to-python
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.