[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.1.3 10/55] tracetool: avoid invalid escape in Python string
From: |
Michael Tokarev |
Subject: |
[Stable-8.1.3 10/55] tracetool: avoid invalid escape in Python string |
Date: |
Thu, 9 Nov 2023 16:42:14 +0300 |
From: Paolo Bonzini <pbonzini@redhat.com>
This is an error in Python 3.12; fix it by using a raw string literal.
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit e6d8e5e6e366ab4c9ed7d8ed1572f98c6ad6a38e)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 33cf85e2b0..b29594d75e 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -210,12 +210,12 @@ class Event(object):
"""
- _CRE = re.compile("((?P<props>[\w\s]+)\s+)?"
- "(?P<name>\w+)"
- "\((?P<args>[^)]*)\)"
- "\s*"
- "(?:(?:(?P<fmt_trans>\".+),)?\s*(?P<fmt>\".+))?"
- "\s*")
+ _CRE = re.compile(r"((?P<props>[\w\s]+)\s+)?"
+ r"(?P<name>\w+)"
+ r"\((?P<args>[^)]*)\)"
+ r"\s*"
+ r"(?:(?:(?P<fmt_trans>\".+),)?\s*(?P<fmt>\".+))?"
+ r"\s*")
_VALID_PROPS = set(["disable", "vcpu"])
@@ -326,7 +326,7 @@ def __repr__(self):
fmt)
# Star matching on PRI is dangerous as one might have multiple
# arguments with that format, hence the non-greedy version of it.
- _FMT = re.compile("(%[\d\.]*\w+|%.*?PRI\S+)")
+ _FMT = re.compile(r"(%[\d\.]*\w+|%.*?PRI\S+)")
def formats(self):
"""List conversion specifiers in the argument print format string."""
diff --git a/scripts/tracetool/format/log_stap.py
b/scripts/tracetool/format/log_stap.py
index 0b6549d534..b49afababd 100644
--- a/scripts/tracetool/format/log_stap.py
+++ b/scripts/tracetool/format/log_stap.py
@@ -83,7 +83,7 @@ def c_fmt_to_stap(fmt):
# and "%ll" is not valid at all. Similarly the size_t
# based "%z" size qualifier is not valid. We just
# strip all size qualifiers for sanity.
- fmt = re.sub("%(\d*)(l+|z)(x|u|d)", "%\\1\\3", "".join(bits))
+ fmt = re.sub(r"%(\d*)(l+|z)(x|u|d)", r"%\1\3", "".join(bits))
return fmt
def generate(events, backend, group):
--
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 09/55] tests/vm: avoid invalid escape in Python string, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 10/55] tracetool: avoid invalid escape in Python string,
Michael Tokarev <=
- [Stable-8.1.3 05/55] tests/docker: 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 13/55] linux-user/sh4: Fix crashes on signal delivery, 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 11/55] linux-user: Fixes for zero_bss, 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 21/55] block: Fix locking in media change monitor commands, Michael Tokarev, 2023/11/09