On 10/9/24 09:36, Thomas Huth wrote:
On 10/09/2024 08.41, Philippe Mathieu-Daudé wrote:
line 16, in tesseract_available
(stdout, stderr, ret) = run_cmd([ 'tesseract', '--version'])
File "/home/rth/qemu/src/tests/functional/qemu_test/cmd.py", line
69, in run_cmd
subp = subprocess.Popen(args,
File "/usr/lib64/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib64/python3.9/subprocess.py", line 1837, in
_execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'tesseract'
While looking at this, I'm surprised to notice has_cmd() actually
*runs* the command by calling run_cmd(). I'd have expected it solely
checks for binary presence and RX perms, avoiding unexpected side
effects.
It uses "which" to search for the binary ... that could be done better
for sure (especially since "which" might not be available on all
systems), but it already was done this way in the Avocado tests, so at
least that's not a regression.
Sure, I just wanted to share my surprise before forgetting ;)