qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Fix compilation with python-3 if en_US.UTF-8 is unavailable
@ 2018-06-14 15:43 Matthias Maier
  2018-06-14 15:43 ` [Qemu-devel] [PATCH 1/2] Partially revert commit d4e5ec877ca Matthias Maier
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Matthias Maier @ 2018-06-14 15:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P . Berrange, Eduardo Habkost

Hi,

This patch series,
 - removes the PYTHON_UTF8 workaround introduced in d4e5ec877ca
 - adds a different workaround that avoids the locale problem altogether by
   opening files in binary read/write mode and setting encoding/decoding
   (in utf-8) explicitly

The problem with setting

  LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8

is that the en_US.UTF-8 locale might not be available. In this case setting
above locales results in build errors even though another UTF-8 locale was
originally set [1].

We propose a different approach to fix the locale dependent encode/decode
problem in common.py utilizing the binary read/write mode [2,3] and
decode/encode with explicit UTF-8 encoding arguments [4].

This approach is preferred over the fix in commit d4e5ec877ca because it is
(a) locale independent, and (b) does not depend on the en_US.UTF_8 locale
to be available.

Best,
Matthias and Arfrever


[1] https://bugs.gentoo.org/657766
[2] https://docs.python.org/3.6/library/stdtypes.html#bytes.decode
[3] https://docs.python.org/3.6/library/stdtypes.html#str.encode
[4] https://docs.python.org/3/howto/unicode.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-06-18 22:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-14 15:43 [Qemu-devel] [PATCH 0/2] Fix compilation with python-3 if en_US.UTF-8 is unavailable Matthias Maier
2018-06-14 15:43 ` [Qemu-devel] [PATCH 1/2] Partially revert commit d4e5ec877ca Matthias Maier
2018-06-15 20:34   ` Eduardo Habkost
2018-06-15 21:12     ` Matthias Maier
2018-06-14 15:43 ` [Qemu-devel] [PATCH 2/2] qapi: open files in binary mode and use explicit decoding/encoding in common.py Matthias Maier
2018-06-14 17:04 ` [Qemu-devel] [PATCH 0/2] Fix compilation with python-3 if en_US.UTF-8 is unavailable no-reply
2018-06-18 22:15   ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).