On Fri, Jan 8, 2021 at 3:31 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Hi Peter,
>
> Le ven. 8 janv. 2021 11:35, Peter Maydell <peter.maydell@linaro.org> a écrit :
>>
>> On Thu, 7 Jan 2021 at 22:25, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>> >
>> > The following changes since commit 470dd6bd360782f5137f7e3376af6a44658eb1d3:
>> >
>> >   Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-060121-4' into staging (2021-01-06 22:18:36 +0000)
>> >
>> > are available in the Git repository at:
>> >
>> >   https://gitlab.com/philmd/qemu.git tags/mips-20210107
>> >
>> > for you to fetch changes up to f97d339d612b86d8d336a11f01719a10893d6707:
>> >
>> >   docs/system: Remove deprecated 'fulong2e' machine alias (2021-01-07 22:57:49 +0100)
>> >
>> > ----------------------------------------------------------------
>> > MIPS patches queue
>> >
>> > - Simplify CPU/ISA definitions
>> > - Various maintenance code movements in translate.c
>> > - Convert part of the MSA ASE instructions to decodetree
>> > - Convert some instructions removed from Release 6 to decodetree
>> > - Remove deprecated 'fulong2e' machine alias
>>
>> Hi; this failed to build on some of my hosts:
>>
>> [1/4674] Generating 'libqemu-mipsel-softmmu.fa.p/decode-mips64r6.c.inc'.
>> FAILED: libqemu-mipsel-softmmu.fa.p/decode-mips64r6.c.inc
>> /usr/bin/python3 /home/petmay01/qemu-for-merges/scripts/decodetree.py
>> ../../target/mips/mips64r6.decode --static-deco
>> de=decode_mips64r6 -o libqemu-mipsel-softmmu.fa.p/decode-mips64r6.c.inc
>> Traceback (most recent call last):
>>   File "/home/petmay01/qemu-for-merges/scripts/decodetree.py", line
>> 1397, in <module>
>>     main()
>>   File "/home/petmay01/qemu-for-merges/scripts/decodetree.py", line
>> 1308, in main
>>     parse_file(f, toppat)
>>   File "/home/petmay01/qemu-for-merges/scripts/decodetree.py", line
>> 994, in parse_file
>>     for line in f:
>>   File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
>>     return codecs.ascii_decode(input, self.errors)[0]
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
>> 80: ordinal not in range(128)
Can we always reading file in decodetree with utf8 encoding
And convert all decodetree to utf8 encoding, and the problem should resolved.
```
 scripts/decodetree.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/decodetree.py b/scripts/decodetree.py
index 47aa9caf6d..8c9eb365ac 100644
--- a/scripts/decodetree.py
+++ b/scripts/decodetree.py
@@ -1304,7 +1304,7 @@ def main():
 
     for filename in args:
         input_file = filename
-        f = open(filename, 'r')
+        f = open(filename, 'r', encoding="utf8")
         parse_file(f, toppat)
         f.close()
 
```
>
>
> My lastname in the copyright line =)
>
>> [2/4674] Generating 'libqemu-mipsel-softmmu.fa.p/decode-msa64.c.inc'.
>> FAILED: libqemu-mipsel-softmmu.fa.p/decode-msa64.c.inc
>> /usr/bin/python3 /home/petmay01/qemu-for-merges/scripts/decodetree.py
>> ../../target/mips/msa64.decode --static-decode=
>> decode_msa64 -o libqemu-mipsel-softmmu.fa.p/decode-msa64.c.inc
>> Traceback (most recent call last):
>>   File "/home/petmay01/qemu-for-merges/scripts/decodetree.py", line
>> 1397, in <module>
>>     main()
>>   File "/home/petmay01/qemu-for-merges/scripts/decodetree.py", line
>> 1308, in main
>>     parse_file(f, toppat)
>>   File "/home/petmay01/qemu-for-merges/scripts/decodetree.py", line
>> 994, in parse_file
>>     for line in f:
>>   File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
>>     return codecs.ascii_decode(input, self.errors)[0]
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
>> 93: ordinal not in range(128)
>>
>> etc.
>>
>> Looks like decodetree fails to cope with non-ASCII characters in
>> its input file -- probably this depends on the host locale settings:
>> I think these hosts run in the 'C' locale.
>
>
> Can you provide more information on your host so we can cover it in Gitlab-CI?
>
> Thanks,
>
> Phil.



--
         此致

罗勇刚
Yours
    sincerely,
Yonggang Luo