Re: [PATCH v2 03/24] build: force a UTF-8 locale for python

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/11/19 11:23 AM, Daniel P. Berrangé wrote:
> Python3 versions less than 3.7 have very unhelpful handling
> of the C locale where they assume data is 7-bit only. This
> violates POSIX which requires the C locale to be 8-bit clean.
> Python3 >= 3.7 now assumes that the C locale is always UTF-8.

Being UTF-8 vs. being 8-bit clean are not necessarily synonymous, but
the difference shouldn't matter when we only use UTF-8 encoding in our
script source code and inputs.

> 
> Set env variables to force LC_CTYPE to en_US.UTF-8 so that
> we get UTF-8 handling on all python versions. Note we do
> not use C.UTF-8 since not all C libraries support that.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
> ---
>  Makefile.am                | 2 +-
>  configure.ac               | 8 ++++++++
>  docs/Makefile.am           | 3 ++-
>  src/esx/Makefile.inc.am    | 2 +-
>  src/hyperv/Makefile.inc.am | 2 +-
>  src/util/Makefile.inc.am   | 8 ++++----
>  6 files changed, 17 insertions(+), 8 deletions(-)

Reviewed-by: Eric Blake <eblake@xxxxxxxxxx>


> +++ b/src/esx/Makefile.inc.am
> @@ -63,7 +63,7 @@ $(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)
>  
>  $(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
>                           $(srcdir)/esx/esx_vi_generator.py
> -	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
> +	$(AM_V_GEN)srcdir=$(srcdir) $(RUNUTF8) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
>  	  && touch $@

Worth rewrapping long lines any differently, since your addition pushes
this beyond 80 columns?


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux