From 2f3d16e54f59eddc7c3cee07bd86e7f5b3993741 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Apr 12 2024 22:46:32 +0000 Subject: In the fallback existing bug check, regex escape the change name We had a case where this fallback should have worked but didn't, for the change "SPDX License Phase 4 (The last one)". The problem of course is that the change name has parentheses in it, and we're doing a regex search. The parentheses are being interpreted as regex syntax. Let's fix this by running `re.escape()` on the change name when constructing the query. I tested that this works. Signed-off-by: Adam Williamson --- diff --git a/changes/createbz.py b/changes/createbz.py index d67455b..2760cb7 100644 --- a/changes/createbz.py +++ b/changes/createbz.py @@ -28,6 +28,7 @@ import csv from optparse import OptionParser import bugzilla +import re import time import xmlrpc.client @@ -61,7 +62,7 @@ if __name__ == "__main__": # another check for an existing bug, in case this script is # run twice without feature-pages.csv being updated query = bz.build_query( - short_desc="^" + record["Name"] + "$", + short_desc="^" + re.escape(record["Name"]) + "$", component="Changes Tracking", product="Fedora" )