summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbiao716.wang <biao716.wang@samsung.com>2023-04-25 15:20:41 +0900
committerbiao716.wang <biao716.wang@samsung.com>2023-05-04 13:05:43 +0900
commit95e33623ea4c69c1ce3360904f053d5a1a172ed3 (patch)
tree2427207099742f930570e5a2a500052bacb07908
parentee0f349b35bf463642ecf845a94a2b5bb54efff3 (diff)
downloadgit-buildpackage-95e33623ea4c69c1ce3360904f053d5a1a172ed3.tar.gz
git-buildpackage-95e33623ea4c69c1ce3360904f053d5a1a172ed3.tar.bz2
git-buildpackage-95e33623ea4c69c1ce3360904f053d5a1a172ed3.zip
fix run error: re.error: bad escape \S at position 7
Change-Id: I6f9e25806b43aa66a1c05cad0d54edbc656f733b Signed-off-by: biao716.wang <biao716.wang@samsung.com>
-rw-r--r--gbp/deb/changelog.py2
-rw-r--r--gbp/rpm/__init__.py2
-rw-r--r--gbp/scripts/common/pq.py1
-rwxr-xr-xgbp/scripts/rpm_ch.py2
4 files changed, 4 insertions, 3 deletions
diff --git a/gbp/deb/changelog.py b/gbp/deb/changelog.py
index 41aca947..a670332e 100644
--- a/gbp/deb/changelog.py
+++ b/gbp/deb/changelog.py
@@ -96,7 +96,7 @@ class ChangeLog(object):
(output, errors) = cmd.communicate(self._contents.encode('utf-8'))
if cmd.returncode:
raise ParseChangeLogError("Failed to parse changelog. "
- "dpkg-parsechangelog said:\n%s" % errors.decode().strip()))
+ "dpkg-parsechangelog said:\n%s" % errors.decode().strip())
# Parse the result of dpkg-parsechangelog (which looks like
# email headers)
cp = email.message_from_string(output)
diff --git a/gbp/rpm/__init__.py b/gbp/rpm/__init__.py
index 62f0c279..0affa457 100644
--- a/gbp/rpm/__init__.py
+++ b/gbp/rpm/__init__.py
@@ -199,7 +199,7 @@ class SpecFile(object):
librpm.spec(filtered.name)
return librpm.spec(filtered.name)
except ValueError as err:
- rpmlog = get_librpm_log()
+ rpmlog = [log.decode() for log in get_librpm_log()]
gbp.log.debug("librpm log:\n %s" %
"\n ".join(rpmlog))
raise GbpError("RPM error while parsing %s: %s (%s)" %
diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py
index 95516c08..05993d1d 100644
--- a/gbp/scripts/common/pq.py
+++ b/gbp/scripts/common/pq.py
@@ -182,6 +182,7 @@ def patch_path_filter(file_status, exclude_regex=None):
include_paths = []
for file_list in list(file_status.values()):
for fname in file_list:
+ fname = fname.decode()
if not re.match(exclude_regex, fname):
include_paths.append(fname)
else:
diff --git a/gbp/scripts/rpm_ch.py b/gbp/scripts/rpm_ch.py
index b2a836aa..d134b76d 100755
--- a/gbp/scripts/rpm_ch.py
+++ b/gbp/scripts/rpm_ch.py
@@ -186,7 +186,7 @@ def guess_commit(section, repo, options):
header = section.header
# Try to parse the fields from the header revision
- rev_re = '^%s$' % re.sub(r'%\((\S+?)\)s', r'(?P<\1>\S+)',
+ rev_re = '^%s$' % re.sub(r'%\((\S+?)\)s', r'(?P<\1>\\S+)',
options.changelog_revision)
match = re.match(rev_re, header['revision'], re.I)
fields = match.groupdict() if match else {}