This is an archive of the discontinued LLVM Phabricator instance.

Use `bytes`, not `str`, to return C++ strings to Python.
ClosedPublic

Authored by chr1sj0nes on Apr 7 2023, 3:33 PM.

Details

Summary

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

Diff Detail

Event Timeline

chr1sj0nes created this revision.Apr 7 2023, 3:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2023, 3:33 PM
chr1sj0nes requested review of this revision.Apr 7 2023, 3:33 PM

Use bytes, not str, to return C++ opaque attributes to Python, and add value_bytes for string attributes.

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

ftynse accepted this revision.Apr 12 2023, 8:39 AM
This revision is now accepted and ready to land.Apr 12 2023, 8:39 AM

Thanks for the review. Please can somebody submit the change? I don't think I have permissions.

This revision was automatically updated to reflect the committed changes.