[PATCH] D30773: Make git-clang-format python 3 compatible

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 8 23:34:29 PST 2017


EricWF added a comment.

In https://reviews.llvm.org/D30773#696349, @mgorny wrote:

> In https://reviews.llvm.org/D30773#696301, @EricWF wrote:
>
> > There seem to be a couple cases where it's non-trivial to convert the output from `bytes` to `str`. I'll look into this further and update.
>
>
> Generally bytes<->str conversion should be done using `.decode()` and `.encode()`, i.e. respecting a particular character encoding in bytes.


Right, and that's what I'm currently doing. The non-trivial cases are where we have an open file object referring to output from a child process instead of a string representing the full output.


https://reviews.llvm.org/D30773





More information about the cfe-commits mailing list