]> xenbits.xensource.com Git - people/aperard/xtf.git/commitdiff
xtf-runner: python3 fix bookworm-fix
authorAnthony PERARD <anthony.perard@citrix.com>
Wed, 16 Aug 2023 10:21:46 +0000 (11:21 +0100)
committerAnthony PERARD <anthony.perard@citrix.com>
Wed, 16 Aug 2023 10:22:14 +0000 (11:22 +0100)
issue:
  File "/home/xtf/xtf-runner", line 410, in interpret_selection
    if not line.startswith("xen_caps"):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Adding `universal_newlines` open stdout as text file, so line should
be a `str`. `universal_newlines` is available on python 2.7. A new
alias `text` is only available python 3.7.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
xtf-runner

index 6352a5b3e1268baf1f9a5986ff7ace4a5c397898..5741e64169395528bcd7ce45ac2bcbaa8e89a416 100755 (executable)
@@ -403,7 +403,7 @@ def interpret_selection(opts):
 
         host_envs = []
 
-        cmd = Popen(['xl', 'info'], stdout = PIPE)
+        cmd = Popen(['xl', 'info'], stdout = PIPE, universal_newlines=True)
         stdout, _ = cmd.communicate()
 
         for line in stdout.splitlines():