Skip to content
Snippets Groups Projects
Commit 87603e02 authored by Sebastien Helleu's avatar Sebastien Helleu
Browse files

Ignore UTF-8 decoding errors

The script was throwing an error when building chart "authors" with
Linux git repository (some names are not UTF-8 valid). The decoding
errors are now ignored.
parent 5315960d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -48,7 +48,7 @@ import subprocess
import sys
import traceback
 
VERSION = '0.8'
VERSION = '0.9'
 
 
class GitChart:
Loading
Loading
@@ -103,12 +103,12 @@ class GitChart:
p2 = subprocess.Popen(command2, stdin=p1.stdout,
stdout=subprocess.PIPE)
p1.stdout.close()
return p2.communicate()[0].decode('utf-8').strip().split('\n')
return p2.communicate()[0].decode('utf-8', errors='ignore').strip().split('\n')
else:
# execute a single git cmd and return output
p = subprocess.Popen(command1, stdout=subprocess.PIPE,
cwd=self.repository)
return p.communicate()[0].decode('utf-8').strip().split('\n')
return p.communicate()[0].decode('utf-8', errors='ignore').strip().split('\n')
 
def _generate_bar_chart(self, data, sorted_keys=None, max_keys=0,
max_x_labels=0, x_label_rotation=0):
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment