[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XTF PATCH] xtf-runner: python3 fix


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Thu, 17 Aug 2023 11:51:11 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Thu, 17 Aug 2023 10:51:29 +0000
  • Ironport-data: A9a23:Mx49/K2TIXHEadsAVfbD5dZxkn2cJEfYwER7XKvMYLTBsI5bpzEDy zEaXWuOPv2MYzb0Kd5waNi28hgF7JfSzNFjTwJspC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gxnOqgS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfJ0xP/ 6xIb3c2QyunmLruz+u5SeJhiZF2RCXrFNt3VnBIyDjYCbAtQIzZQrWM7thdtNsyrpkQR7CEP ZNfMGcxKk2aOHWjOX9OYH46tO6umnn4dSwesF+PrLA7y2PS0BZwwP7mN9+9ltmiHJ8NxxfD+ zObl4j/KiFGHtaTlAG/zmD2mPDTpy/AftMpBoTto5aGh3XMnzdOWXX6T2CTsfS/z0KzRd9bA 0gV4TY167g/8lSxSdvwVAH+p2SL1iPwQPIJTbd8slvUjPOJvUDAXDNsoiN9hMIOkuI3T2x6k RiysujNGmQ3v+SXSnmQ+eLBxd+tAhQ9IWgHbC4CaAIK5dj/vY0+5i7yosZf/L2d1YOsR2ypq 9yehG1n3uhI05ZXv0mu1Qqf6w9AsKQlWeLcCu//emu+pj10a4e+D2BDwQiKtK0QRGp1o7Tog ZTlpyR8xLpTZX1uvHbXKAnoIF1Pz6zYWNE7qQc2d6TNDxz3pxaekXl4uVmS3ntBPMceYiPOa 0TOow5X75I7FCL0PPUtOtrvW5tylfiI+THZuhb8NIsmjn9ZLlPvwc2TTRTIgzCFfLYEwMnTx qt3ge7zVC1HWMyLPRK9RvsH0K9D+8zN7Tq7eHwP9Dz+ieD2TCfMGd843K6mMrhRAFWs/F+Er L6y9qKil31ibQEJSnOMrddLcwlRfRDWx/ne8qRqSwJKGSI+cElJNhMb6ehJl1BN90iNqtr1w w==
  • Ironport-hdrordr: A9a23:g/cQjKmQf9xO2o1nx5dtxUc0bmLpDfLr3DAbv31ZSRFFG/FwyP re/sjzhCWVtN9OYgBCpTnyAtjwfZq6z+8A3WBxB8bWYOCCggqVxe5ZnOzfKlHbal7DHgA079 YYT0BRYOeAdWSSp/yKhjVRKr4bsaK6GErBv5al854Vd3AWV0gC1XYHNu/4KDwTeOAuP/NQf/ DwiaQ3wgZIVk5nEvhTbUN1LdQryee75K4OLSR2eSLPhTPjsQ+V
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 in python 3.7.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---

Notes:
    I've only tested the patch on Debian Bookworm, with python-is-python3
    package (python symlink) as osstest run `./xtf-runner ...`.
    
    I haven't tried python2.7.

 xtf-runner | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xtf-runner b/xtf-runner
index 6352a5b..5741e64 100755
--- a/xtf-runner
+++ b/xtf-runner
@@ -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():
-- 
Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.