[Mesa-dev] [PATCH 12/14] util/gen_xmlpool: Don't write via shell redirection

Ilia Mirkin imirkin at alum.mit.edu
Wed Oct 31 20:16:50 UTC 2018


On Fri, Oct 26, 2018 at 1:24 PM Dylan Baker <dylan at pnwbakers.com> wrote:
>
> This is bad for a couple of reasons, but the worst is that it gets the
> shell involved. When the shell gets involved we can start running into
> problems with LANG, namely LANG=C. This is particularly obnoxious for
> translation files, since there is a very high likelyhood of running into
> unicode in them. If we write it in python through file.write we don't
> have this problem as python just shovels bits into a file, and the shell
> doesn't know, and thus doesn't care.

Not a comment on the implementation, but rather on the commit message --

The shell couldn't care less about any of this, and is entirely
uninvolved in the problem. Python 3's stdout/stderr abstractions are
what's upsetting things. Instead of taking bytes (since stdout/stderr,
and in fact all files, are byte-oriented things deep down inside),
they are taking unicode codepoints. This used to work fine in py2, but
then it got "fixed".

Cheers,

  -ilia


More information about the mesa-dev mailing list