glib-mkenums: Python2: use locale encoding when redirecting stdout867b5e6f902e945e8a02a3d2d35d698e19f8f892
commit867b5e6f902e945e8a02a3d2d35d698e19f8f892
authorChristoph Reiter <creiter@src.gnome.org>
Wed, 26 Jul 2017 09:26:00 +0000 (26 11:26 +0200)
committerChristoph Reiter <creiter@src.gnome.org>
Wed, 26 Jul 2017 20:27:48 +0000 (26 22:27 +0200)
tree10f945512606465288a76a7d470d14dfbb427141
parenta7926117dde57d6408f292b54d9950b3a1f4cb79
glib-mkenums: Python2: use locale encoding when redirecting stdout

In case of Python 2 and stdout being redirected to a file, sys.stdout.encoding
is None and it defaults ASCII for encoding text.

To match the behaviour of Python 3, which uses the locale encoding also when
redirecting to a file, wrap sys.stdout with a StreamWriter using the
locale encoding.

https://bugzilla.gnome.org/show_bug.cgi?id=785113
gobject/glib-mkenums.in