In python3 pexpect wants by default a BytesIO stream as log buffer. Otherwise it will (silently masked since we just return false) File "/usr/share/dpdk/test/autotest_runner.py", line 22, in wait_prompt child.sendline() File "/usr/lib/python3/dist-packages/pexpect/pty_spawn.py", line 555, in sendline return self.send(s + self.linesep) File "/usr/lib/python3/dist-packages/pexpect/pty_spawn.py", line 543, in send self._log(s, 'send') File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 126, in _log self.logfile.write(s)
We have plenty of other code writing and using this buffer. So instead of changing the type and modifying many more places we tell the spawn [1] method to encode things right away - then the rest behaves as it did with python2. [1]: https://pexpect.readthedocs.io/en/stable/api/pexpect.html#spawn-class Signed-off-by: Christian Ehrhardt <christian.ehrha...@canonical.com> --- app/test/autotest_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/autotest_runner.py b/app/test/autotest_runner.py index dfa5f2b2dd..92d4e6e41a 100644 --- a/app/test/autotest_runner.py +++ b/app/test/autotest_runner.py @@ -84,7 +84,7 @@ def pool_init(queue, result_queue): print("\n%s %s\n" % ("=" * 20, prefix), file=startuplog) print("\ncmdline=%s" % cmdline, file=startuplog) - pool_child = pexpect.spawn(cmdline, logfile=startuplog) + pool_child = pexpect.spawn(cmdline, logfile=startuplog, encoding='utf-8') # wait for target to boot if not wait_prompt(pool_child): -- 2.26.0