Skip to content

Commit 7e59041

Browse files
committed
Fix more unicode stuff for python2
1 parent 7e8daeb commit 7e59041

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

jinja2cli/cli.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ def cli(opts, args):
306306
else:
307307
out = open(opts.outfile, "w")
308308

309+
if not PY3:
310+
import codecs
311+
312+
out = codecs.getwriter("utf8")(out)
313+
309314
out.write(render(template_path, data, extensions, opts.strict))
310315
out.flush()
311316
return 0

0 commit comments

Comments
 (0)