on machine without display (ssh session) trying to run runqemu qemux86 this action leads to the error runqemu script meet error in handling this error: Traceback (most recent call last): File "/home/ibragimov/yocto/work/poky/scripts/runqemu", line 1349, in main config.start_qemu() File "/home/ibragimov/yocto/work/poky/scripts/runqemu", line 1245, in start_qemu logger.error("Failed to run qemu: %s", process.stderr.read().decode()) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd1 in position 58: invalid continuation byte this is code which causes error: if retcode: if retcode == -signal.SIGTERM: logger.info("Qemu terminated by SIGTERM") else: logger.error("Failed to run qemu: %s", process.stderr.read().decode()) #< error here this command runs successfully: runqemu qemux86 nographics suggested fix at the line 1245: logger.error("Failed to run qemu: %s", process.stderr.read().decode("utf-8", "replace")
What locale/encoding are you using in the ssh session?
echo $LANG en_US.UTF-8
I used putty in Windows to connect to remote host with Yocto. I suggest, runqemu got message from Windows in CP-1251 encoding, it is Cyrillic. "Сетевая ошибка: В соединении отказано" It is content of process.stderr.read()
upd: this code show the message logger.error("Failed to run qemu: %s", err_str.decode("cp1251", "replace")) runqemu - ERROR - Failed to run qemu: PuTTY X11 proxy: unable to connect to forwarded X server: Сетевая ошибка: В соединении отказано Could not initialize SDL(x11 not available) - exiting
Can't you just tell putty to use UTF-8? There's lots of places where we expect UTF-8 and if random other encodings can appear then they'll break too.
Yes, I tell putty to use utf-8 in the beginning. But probably cp-1251 appears in responce to X11 request.
I mean, it is X11-server-dependent message, independent of ssh client.
$ iconv -f utf-8 -t cp1251 Сетевая ошибка: В соединении отказано ������� ������: � ���������� �������� If we just used errors='replace' the entire string would be question marks. Not sure how to solve this problem in runqemu, the problem is that the Putty X11 proxy isn't respecting the transport encoding when sending error messages.