From fb21c560786324c02527ac25fd215fe50690c502 Mon Sep 17 00:00:00 2001 From: Maxwell Date: Mon, 21 Oct 2013 17:29:18 -0200 Subject: [PATCH] Fix UnicodeDecodeError Traceback (most recent call last): File "./lib/wnf.py", line 590, in run() File "./lib/wnf.py", line 314, in run build.bundle(False, cms_make) File "/home/maxwell/erp/lib/webnotes/build.py", line 27, in bundle on_build() File "app/startup/event_handlers.py", line 69, in on_build File "app/home/page/latest_updates/latest_updates.py", line 42, in make File "app/home/page/latest_updates/latest_updates.py", line 18, in add_to_logs UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128) --- home/page/latest_updates/latest_updates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home/page/latest_updates/latest_updates.py b/home/page/latest_updates/latest_updates.py index 4eb208f9521..b4e3f440a93 100644 --- a/home/page/latest_updates/latest_updates.py +++ b/home/page/latest_updates/latest_updates.py @@ -14,6 +14,7 @@ def make(): out.seek(0) last_commit = None for l in out.readlines(): + l = l.decode('utf-8') if last_commit is not None: if l.startswith("Date:"): last_commit["date"] = l[8:-1] @@ -59,4 +60,4 @@ def make(): lufile.write(json.dumps(logs, indent=1, sort_keys=True)) if __name__=="__main__": - make() \ No newline at end of file + make()