[libvirt] [PATCH glib] Don't set LC_ALL=C during build as that breaks python apps

Setting LC_ALL=C breaks python apps doing I/O on UTF-8 source files. In particular this broke glib-mkenums GEN libvirt-gconfig-enum-types.h Traceback (most recent call last): File "/usr/bin/glib-mkenums", line 669, in <module> process_file(fname) File "/usr/bin/glib-mkenums", line 406, in process_file line = curfile.readline() File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 849: ordinal not in range(128) Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- Pushed to fix rawhide build maint.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maint.mk b/maint.mk index 405c6d0..ef72b4f 100644 --- a/maint.mk +++ b/maint.mk @@ -117,8 +117,8 @@ news-check-lines-spec ?= 1,10 news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)' # Prevent programs like 'sort' from considering distinct strings to be equal. -# Doing it here saves us from having to set LC_ALL elsewhere in this file. -export LC_ALL = C +# Doing it here saves us from having to set LC_COLLATE elsewhere in this file. +export LC_COLLATE = C ## --------------- ## ## Sanity checks. ## -- 2.13.3

Hello, Am 25.07.2017 um 14:07 schrieb Daniel P. Berrange:
Setting LC_ALL=C breaks python apps doing I/O on UTF-8 source files. In particular this broke glib-mkenums
GEN libvirt-gconfig-enum-types.h Traceback (most recent call last): File "/usr/bin/glib-mkenums", line 669, in <module> process_file(fname) File "/usr/bin/glib-mkenums", line 406, in process_file line = curfile.readline() File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 849: ordinal not in range(128)
What about using "C.UTF-8" instead, which us the same as "C" but with "UTF-8" encoding? Maybe ancient RedHat still doesn't know about it ... Philipp

On Tue, Jul 25, 2017 at 06:16:49PM +0200, Philipp Hahn wrote:
Hello,
Am 25.07.2017 um 14:07 schrieb Daniel P. Berrange:
Setting LC_ALL=C breaks python apps doing I/O on UTF-8 source files. In particular this broke glib-mkenums
GEN libvirt-gconfig-enum-types.h Traceback (most recent call last): File "/usr/bin/glib-mkenums", line 669, in <module> process_file(fname) File "/usr/bin/glib-mkenums", line 406, in process_file line = curfile.readline() File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 849: ordinal not in range(128)
What about using "C.UTF-8" instead, which us the same as "C" but with "UTF-8" encoding? Maybe ancient RedHat still doesn't know about it ...
It isn't portable. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (2)
-
Daniel P. Berrange
-
Philipp Hahn