Re: [PATCH] decodetree: Open files with encoding='utf-8'

2021-01-12 Thread Philippe Mathieu-Daudé
On 1/13/21 12:35 AM, John Snow wrote: > On 1/12/21 4:11 PM, Eduardo Habkost wrote: >> [CCing John, Wainer] >> >> On Fri, Jan 08, 2021 at 05:51:41PM -0500, Daniele Buono wrote: >>> I had a similar issue in the past with the acceptance tests. >>> Some VMs send UTF-8 output in their console and the ac

Re: [PATCH] decodetree: Open files with encoding='utf-8'

2021-01-12 Thread John Snow
On 1/12/21 4:11 PM, Eduardo Habkost wrote: [CCing John, Wainer] On Fri, Jan 08, 2021 at 05:51:41PM -0500, Daniele Buono wrote: I had a similar issue in the past with the acceptance tests. Some VMs send UTF-8 output in their console and the acceptance test script would bail out if the locale was

Re: [PATCH] decodetree: Open files with encoding='utf-8'

2021-01-12 Thread Eduardo Habkost
[CCing John, Wainer] On Fri, Jan 08, 2021 at 05:51:41PM -0500, Daniele Buono wrote: > I had a similar issue in the past with the acceptance tests. > Some VMs send UTF-8 output in their console and the acceptance test > script would bail out if the locale was not UTF-8. > > I sent a patch on the m

Re: [PATCH] decodetree: Open files with encoding='utf-8'

2021-01-08 Thread Daniele Buono
I had a similar issue in the past with the acceptance tests. Some VMs send UTF-8 output in their console and the acceptance test script would bail out if the locale was not UTF-8. I sent a patch on the ml but it probably got lost: https://lists.gnu.org/archive/html/qemu-devel/2020-07/msg06086.htm

Re: [PATCH] decodetree: Open files with encoding='utf-8'

2021-01-08 Thread Philippe Mathieu-Daudé
On 1/8/21 6:14 PM, Peter Maydell wrote: > On Fri, 8 Jan 2021 at 16:44, Philippe Mathieu-Daudé wrote: >> >> On 1/8/21 4:38 PM, Peter Maydell wrote: >>> Should we also be opening the output file explicitly as >>> utf-8 ? (How do we say "write to sys.stdout as utf-8" for >>> the case where we're doin

Re: [PATCH] decodetree: Open files with encoding='utf-8'

2021-01-08 Thread Peter Maydell
On Fri, 8 Jan 2021 at 16:44, Philippe Mathieu-Daudé wrote: > > On 1/8/21 4:38 PM, Peter Maydell wrote: > > Should we also be opening the output file explicitly as > > utf-8 ? (How do we say "write to sys.stdout as utf-8" for > > the case where we're doing that?) > > I have been wondering about it,

Re: [PATCH] decodetree: Open files with encoding='utf-8'

2021-01-08 Thread Philippe Mathieu-Daudé
On 1/8/21 4:38 PM, Peter Maydell wrote: > On Fri, 8 Jan 2021 at 15:16, Philippe Mathieu-Daudé wrote: >> >> When decodetree.py was added in commit 568ae7efae7, QEMU was >> using Python 2 which happily reads UTF-8 files in text mode. >> Python 3 requires either UTF-8 locale or an explicit encoding >

Re: [PATCH] decodetree: Open files with encoding='utf-8'

2021-01-08 Thread Eduardo Habkost
On Sat, Jan 09, 2021 at 12:13:31AM +0800, 罗勇刚(Yonggang Luo) wrote: > On Sat, Jan 9, 2021 at 12:05 AM Peter Maydell > wrote: > > > > On Fri, 8 Jan 2021 at 15:16, Philippe Mathieu-Daudé > wrote: > > > > > > When decodetree.py was added in commit 568ae7efae7, QEMU was > > > using Python 2 which happ

Re: [PATCH] decodetree: Open files with encoding='utf-8'

2021-01-08 Thread Yonggang Luo
On Sat, Jan 9, 2021 at 12:05 AM Peter Maydell wrote: > > On Fri, 8 Jan 2021 at 15:16, Philippe Mathieu-Daudé wrote: > > > > When decodetree.py was added in commit 568ae7efae7, QEMU was > > using Python 2 which happily reads UTF-8 files in text mode. > > Python 3 requires either UTF-8 locale or an

Re: [PATCH] decodetree: Open files with encoding='utf-8'

2021-01-08 Thread Peter Maydell
On Fri, 8 Jan 2021 at 15:16, Philippe Mathieu-Daudé wrote: > > When decodetree.py was added in commit 568ae7efae7, QEMU was > using Python 2 which happily reads UTF-8 files in text mode. > Python 3 requires either UTF-8 locale or an explicit encoding > passed to open(). Now that Python 3 is requir

Re: [PATCH] decodetree: Open files with encoding='utf-8'

2021-01-08 Thread Yonggang Luo
On Fri, Jan 8, 2021 at 7:18 AM Philippe Mathieu-Daudé wrote: > > When decodetree.py was added in commit 568ae7efae7, QEMU was > using Python 2 which happily reads UTF-8 files in text mode. > Python 3 requires either UTF-8 locale or an explicit encoding > passed to open(). Now that Python 3 is requ

[PATCH] decodetree: Open files with encoding='utf-8'

2021-01-08 Thread Philippe Mathieu-Daudé
When decodetree.py was added in commit 568ae7efae7, QEMU was using Python 2 which happily reads UTF-8 files in text mode. Python 3 requires either UTF-8 locale or an explicit encoding passed to open(). Now that Python 3 is required, explicit UTF-8 encoding for decodetree sources. This fixes: $