Gracefully handling unicode errors

This commit is contained in:
B
2015-05-02 13:32:34 +02:00
parent 80e2ea31d0
commit 8a0ec3c268
+1 -1
View File
@@ -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):