From c37fc953a26bb385ee7e3bde0291e1df81e1db5e Mon Sep 17 00:00:00 2001 From: Gabriel Kihlman Date: Fri, 20 Dec 2024 09:38:27 +0100 Subject: [PATCH] signi.py: checkfiles expects a string, not a bytes-like object This matches what is done here: https://github.com/bjornedstrom/python-signify/blob/master/signify/pure.py#L440 before: ``` Signature Verified Traceback (most recent call last): File "/usr/bin/signi.py", line 181, in main() File "/usr/bin/signi.py", line 121, in main for path, status in check.checkfiles(os.getcwd(), message): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/signify/check.py", line 36, in checkfiles for algo, path, ref_digest in re.findall( ^^^^^^^^^^^ File "/usr/lib64/python3.12/re/__init__.py", line 217, in findall return _compile(pattern, flags).findall(string) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: cannot use a string pattern on a bytes-like object ``` after: ``` Signature Verified foo.pem: OK bar.pem: OK ``` --- bin/signi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/signi.py b/bin/signi.py index cbdac16..5842c85 100755 --- a/bin/signi.py +++ b/bin/signi.py @@ -117,7 +117,7 @@ def main(): sys.exit(1) exit_fail = False - for path, status in check.checkfiles(os.getcwd(), message): + for path, status in check.checkfiles(os.getcwd(), message.decode('utf-8')): if args.path: include = (path in args.path) else: