qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] Fix compilation with python-3 if en_US.UTF-8 is unavailable
@ 2018-06-15  4:40 Matthias Maier
  2018-06-15  4:40 ` [Qemu-devel] [PATCH v2 1/2] Partially revert commit d4e5ec877ca Matthias Maier
  2018-06-15  4:40 ` [Qemu-devel] [PATCH v2 2/2] qapi: open files in binary mode and use explicit decoding/encoding in common.py Matthias Maier
  0 siblings, 2 replies; 10+ messages in thread
From: Matthias Maier @ 2018-06-15  4:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P . Berrange, Eduardo Habkost

Hi,

This new version of the patch is now also fully python2 compatible...

Original message:

  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] 10+ messages in thread

end of thread, other threads:[~2018-06-15 21:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-15  4:40 [Qemu-devel] [PATCH v2 0/2] Fix compilation with python-3 if en_US.UTF-8 is unavailable Matthias Maier
2018-06-15  4:40 ` [Qemu-devel] [PATCH v2 1/2] Partially revert commit d4e5ec877ca Matthias Maier
2018-06-15  9:42   ` Daniel P. Berrangé
2018-06-15 13:20     ` Matthias Maier
2018-06-15 15:17       ` Markus Armbruster
2018-06-15 15:51         ` Matthias Maier
2018-06-15 15:20       ` Daniel P. Berrangé
2018-06-15  4:40 ` [Qemu-devel] [PATCH v2 2/2] qapi: open files in binary mode and use explicit decoding/encoding in common.py Matthias Maier
2018-06-15 15:31   ` Markus Armbruster
2018-06-15 21:55     ` Matthias Maier

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).