From 1ad1987b589a53f653f10e8dd232514ffb24cafd Mon Sep 17 00:00:00 2001 From: noah morrison Date: Thu, 22 Jan 2015 21:59:10 -0500 Subject: [PATCH] Fix unicode inside of lists for python 2 --- chevron/renderer.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/chevron/renderer.py b/chevron/renderer.py index 9f03736..c5dea30 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -217,11 +217,16 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache', for thing in scope: # Append it as the most recent scope and render new_scope = [thing] + scopes - output += render(template=tags, scopes=new_scope, - partials_path=partials_path, - partials_ext=partials_ext, - partials_dict=partials_dict, - def_ldel=def_ldel, def_rdel=def_rdel) + rend = render(template=tags, scopes=new_scope, + partials_path=partials_path, + partials_ext=partials_ext, + partials_dict=partials_dict, + def_ldel=def_ldel, def_rdel=def_rdel) + + if python3: + output += rend + else: + output += rend.decode('utf-8') else: # Otherwise we're just a scope section -- 2.47.3