[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.1.3 09/55] tests/vm: avoid invalid escape in Python string
From: |
Michael Tokarev |
Subject: |
[Stable-8.1.3 09/55] tests/vm: avoid invalid escape in Python string |
Date: |
Thu, 9 Nov 2023 16:42:13 +0300 |
From: Paolo Bonzini <pbonzini@redhat.com>
This is an error in Python 3.12; fix it by using a raw string literal
or by double-escaping the backslash.
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 86a8989d4557a09b68f8b78b6c3fb6ad3f23ca6f)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index a97e23b0ce..6e31698906 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -331,8 +331,8 @@ def console_init(self, timeout = None):
def console_log(self, text):
for line in re.split("[\r\n]", text):
# filter out terminal escape sequences
- line = re.sub("\x1b\[[0-9;?]*[a-zA-Z]", "", line)
- line = re.sub("\x1b\([0-9;?]*[a-zA-Z]", "", line)
+ line = re.sub("\x1b\\[[0-9;?]*[a-zA-Z]", "", line)
+ line = re.sub("\x1b\\([0-9;?]*[a-zA-Z]", "", line)
# replace unprintable chars
line = re.sub("\x1b", "<esc>", line)
line = re.sub("[\x00-\x1f]", ".", line)
@@ -530,7 +530,7 @@ def get_qemu_version(qemu_path):
and return the major number."""
output = subprocess.check_output([qemu_path, '--version'])
version_line = output.decode("utf-8")
- version_num = re.split(' |\(', version_line)[3].split('.')[0]
+ version_num = re.split(r' |\(', version_line)[3].split('.')[0]
return int(version_num)
def parse_config(config, args):
--
2.39.2
- [Stable-8.1.3 00/55] Patch Round-up for stable 8.1.3, freeze on 2023-11-19, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 01/55] hw/pvrdma: Protect against buggy or malicious guest driver, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 03/55] migration: Non multifd migration don't care about multifd flushes, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 04/55] python/qmp: remove Server.wait_closed() call for Python 3.12, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 02/55] migration: Fix analyze-migration read operation signedness, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 06/55] docs/sphinx: avoid invalid escape in Python string, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 08/55] tests/avocado: avoid invalid escape in Python string, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 09/55] tests/vm: avoid invalid escape in Python string,
Michael Tokarev <=
- [Stable-8.1.3 10/55] tracetool: avoid invalid escape in Python string, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 11/55] linux-user: Fixes for zero_bss, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 13/55] linux-user/sh4: Fix crashes on signal delivery, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 05/55] tests/docker: avoid invalid escape in Python string, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 07/55] target/hexagon: avoid invalid escape in Python string, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 12/55] linux-user/mips: fix abort on integer overflow, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 14/55] lasips2: LASI PS/2 devices are not user-createable, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 15/55] target/arm: Fix CNTPCT_EL0 trapping from EL0 when HCR_EL2.E2H is 0, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 16/55] hw/sd/sdhci: Block Size Register bits [14:12] is lost, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 18/55] target/sparc: Clear may_lookup for npc == DYNAMIC_PC, Michael Tokarev, 2023/11/09