From 8a0ec3c268f15994f94a12a976de3a96609b60e7 Mon Sep 17 00:00:00 2001 From: B Date: Sat, 2 May 2015 13:32:34 +0200 Subject: [PATCH] Gracefully handling unicode errors --- src/frida/tracer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frida/tracer.py b/src/frida/tracer.py index 0947a92..3fa04a0 100644 --- a/src/frida/tracer.py +++ b/src/frida/tracer.py @@ -438,7 +438,7 @@ class Repository(object): try: with open(os.devnull, 'w') as devnull: output = subprocess.check_output(["man", "-P", "col -b", "2", function.name], stderr=devnull) - match = re.search(r"^SYNOPSIS(?:.|\n)*?((?:^.+$\n)* {5}" + function.name + r"\(.*\n(^.+$\n)*)(?:.|\n)*^DESCRIPTION", output.decode(), re.MULTILINE) + match = re.search(r"^SYNOPSIS(?:.|\n)*?((?:^.+$\n)* {5}" + function.name + r"\(.*\n(^.+$\n)*)(?:.|\n)*^DESCRIPTION", output.decode(errors="replace"), re.MULTILINE) if match: decl = match.group(1) for argm in re.finditer(r"([^* ]*)\s*(,|\))", decl):