Re: [Qemu-devel] [PATCH v3 1/2] qapi: open files in binary mode and use explicit decoding/encoding in common.py

2018-06-18 Thread Matthias Maier
On Mon, Jun 18, 2018, at 00:25 CDT, Markus Armbruster wrote: > Matthias Maier writes: > >> This is a different approach to fix the locale dependent encode/decode >> problem in common.py utilizing the binary read/write mode [1,2], and (if >> a python 3 interpreter is us

[Qemu-devel] [PATCH v3 1/2] qapi: open files in binary mode and use explicit decoding/encoding in common.py

2018-06-15 Thread Matthias Maier
Frehtes Taifersar Arahesis Signed-off-by: Matthias Maier --- scripts/qapi/common.py | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 2462fc0291..a368e11a38 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi

[Qemu-devel] [PATCH v3 2/2] Revert commit d4e5ec877ca

2018-06-15 Thread Matthias Maier
stable way of fixing the encoding problem is by explicitly annotating encoding/decoding in the python script. [1] https://bugs.gentoo.org/657766 Signed-off-by: Arfrever Frehtes Taifersar Arahesis Signed-off-by: Matthias Maier --- Makefile | 6 ++ tests/Makefile.include | 6

[Qemu-devel] [PATCH v3 0/2] Fix compilation with python-3 if en_US.UTF-8 is unavailable

2018-06-15 Thread Matthias Maier
Hi, this is hopefully the final iteration of the patches. v3: - reverse order of patches - rename second patch to "Revert commit ..." - drop "UTF-8" argument in decode()/encode(); bot functions default to utf-8 already. v2: - ensure compatibility with python2 by only calling encode()/deco

Re: [Qemu-devel] [PATCH v2 2/2] qapi: open files in binary mode and use explicit decoding/encoding in common.py

2018-06-15 Thread Matthias Maier
On Fri, Jun 15, 2018, at 10:31 CDT, Markus Armbruster wrote: > If I understand 7.2.3. Standard Encodings[*] correctly, the canonical > name is "utf-8". Let's use that. Wait, it's the default, no need to > pass an argument. Roger. I will change this in v3.

Re: [Qemu-devel] [PATCH 1/2] Partially revert commit d4e5ec877ca

2018-06-15 Thread Matthias Maier
On Fri, Jun 15, 2018, at 15:34 CDT, Eduardo Habkost wrote: > Thanks for the patches. It's nice to see that hack go away. > > Patch 2/2 is necessary to make the removal of PYTHON_UTF8 safe, > correct? In that case, I plan to reverse the order of the > patches before applying. Yes, the order o

Re: [Qemu-devel] [PATCH v2 1/2] Partially revert commit d4e5ec877ca

2018-06-15 Thread Matthias Maier
On Fri, Jun 15, 2018, at 10:17 CDT, Markus Armbruster wrote: > "Partially revert"? Which part isn't reverted? Yes, it ended up being a full revert of the commit in question. I am sorry for the sloppy wording. > [...] >>Recently, however, glibc introduced a new locale "C.utf-8" that just

Re: [Qemu-devel] [PATCH v2 1/2] Partially revert commit d4e5ec877ca

2018-06-15 Thread Matthias Maier
On Fri, Jun 15, 2018, at 04:42 CDT, Daniel P. Berrangé wrote: > On Thu, Jun 14, 2018 at 11:40:41PM -0500, Matthias Maier wrote: >> This commit removes the PYTHON_UTF8 workaround. The problem with setting >> >> LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8 >> >> is

[Qemu-devel] [PATCH v2 1/2] Partially revert commit d4e5ec877ca

2018-06-14 Thread Matthias Maier
stable way of fixing the encoding problem is by explicitly annotating encoding/decoding in the python script. [1] https://bugs.gentoo.org/657766 Signed-off-by: Arfrever Frehtes Taifersar Arahesis Signed-off-by: Matthias Maier --- Makefile | 6 ++ tests/Makefile.include | 6

[Qemu-devel] [PATCH v2 2/2] qapi: open files in binary mode and use explicit decoding/encoding in common.py

2018-06-14 Thread Matthias Maier
Signed-off-by: Matthias Maier --- scripts/qapi/common.py | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 2462fc0291..44270cd703 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -16,6 +16,7

[Qemu-devel] [PATCH v2 0/2] Fix compilation with python-3 if en_US.UTF-8 is unavailable

2018-06-14 Thread Matthias Maier
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

[Qemu-devel] [PATCH 1/2] Partially revert commit d4e5ec877ca

2018-06-14 Thread Matthias Maier
locale was originally set [1]. The only stable way of fixing the encoding problem is by explicitly annotating encoding/decoding in the python script. [1] https://bugs.gentoo.org/657766 Signed-off-by: Arfrever Frehtes Taifersar Arahesis Signed-off-by: Matthias Maier --- Makefile | 6

[Qemu-devel] [PATCH 2/2] qapi: open files in binary mode and use explicit decoding/encoding in common.py

2018-06-14 Thread Matthias Maier
-off-by: Arfrever Frehtes Taifersar Arahesis Signed-off-by: Matthias Maier --- scripts/qapi/common.py | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 2462fc0291..8f8ccc65c3 100644 --- a/scripts/qapi/common.py

[Qemu-devel] [PATCH 0/2] Fix compilation with python-3 if en_US.UTF-8 is unavailable

2018-06-14 Thread Matthias Maier
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=