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.
This commit is contained in:
Martin Gracik 2011-03-10 10:53:55 +01:00
parent 8e9f96c12a
commit 0a7f221bd5
1 changed files with 3 additions and 0 deletions

View File

@ -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)