From 0a7f221bd5d615e31dcc07bef8322cdbf01ac3c5 Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Thu, 10 Mar 2011 10:53:55 +0100 Subject: [PATCH] Mako template returns unicode strings (#681003) New mako template returns unicode strings, which are a problem for shlex. We need to encode them to ascii. --- src/pylorax/ltmpl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pylorax/ltmpl.py b/src/pylorax/ltmpl.py index 939d1c52..6485b6bd 100644 --- a/src/pylorax/ltmpl.py +++ b/src/pylorax/ltmpl.py @@ -50,6 +50,9 @@ class LoraxTemplate(object): lines = map(lambda line: line.strip(), lines) lines = filter(lambda line: line, lines) + # mako template now returns unicode strings + lines = map(lambda line: line.encode("ascii"), lines) + # split with shlex lines = map(shlex.split, lines)