[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.15 05/33] tracetool: avoid invalid escape in Python string
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.15 05/33] tracetool: avoid invalid escape in Python string |
Date: |
Sat, 9 Nov 2024 09:38:31 +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 cd46e7597c..e31aaedcbb 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -223,12 +223,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"])
@@ -339,7 +339,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.5
- [Stable-7.2.15 v1 00/33] Patch Round-up for stable 7.2.15, freeze on 2024-11-18, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 01/33] softmmu/physmem.c: Keep transaction attribute in address_space_map(), Michael Tokarev, 2024/11/09
- [Stable-7.2.15 04/33] fuzz: disable leak-detection for oss-fuzz builds, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 03/33] block/reqlist: allow adding overlapping requests, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 02/33] target/ppc: Fix lxvx/stxvx facility check, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 05/33] tracetool: avoid invalid escape in Python string,
Michael Tokarev <=
- [Stable-7.2.15 06/33] linux-user/flatload: Take mmap_lock in load_flt_binary(), Michael Tokarev, 2024/11/09
- [Stable-7.2.15 08/33] scsi: fetch unit attention when creating the request, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 10/33] hw/audio/hda: free timer on exit, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 09/33] hw/intc/arm_gicv3_cpuif: Add cast to match the documentation, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 07/33] linux-user: Fix parse_elf_properties GNU0_MAGIC check, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 11/33] KVM: Dynamic sized kvm memslots array, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 14/33] raw-format: Fix error message for invalid offset/size, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 13/33] tests: Wait for migration completion on destination QEMU to avoid failures, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 12/33] accel/kvm: check for KVM_CAP_READONLY_MEM on VM, Michael Tokarev, 2024/11/09
- [Stable-7.2.15 16/33] target/i386: Avoid unreachable variable declaration in mmu_translate(), Michael Tokarev, 2024/11/09