From c3971099b32820683210f549214abd5c09d08a52 Mon Sep 17 00:00:00 2001 From: Reijo Keskitalo Date: Thu, 21 Dec 2017 10:10:46 -0800 Subject: [PATCH] Python3 requires encoding the input string. Compatible with (at least) Python2.7 --- runjinja.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runjinja.py b/runjinja.py index fd659fa..fb06737 100755 --- a/runjinja.py +++ b/runjinja.py @@ -15,5 +15,5 @@ env = Environment(block_start_string='/*{', extra_vars = dict(len=len) input = sys.stdin.read() -sys.stdout.write('/* DO NOT EDIT. md5sum of source: %s */' % hashlib.md5(input).hexdigest()) +sys.stdout.write('/* DO NOT EDIT. md5sum of source: %s */' % hashlib.md5(input.encode()).hexdigest()) sys.stdout.write(env.from_string(input).render(**extra_vars))