From 073876f66e35501e289cc5dd1d60672e88c893f2 Mon Sep 17 00:00:00 2001
From: "R. Tyler Croy" <tyler@monkeypox.org>
Date: Fri, 22 Apr 2011 17:11:43 -0700
Subject: [PATCH] Apply patch to fix another UnicodeEncodeError
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reported by Carles Muñoz Gorriz in the Debian bug tracker:
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=584966>
Change-Id: Ic6db91b5da9966eaf5b26e2d7170e667915d57c2
---
cheetah/Compiler.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/cheetah/Compiler.py b/cheetah/Compiler.py
index 3f23e4d..80847ff 100644
--- a/cheetah/Compiler.py
+++ b/cheetah/Compiler.py
@@ -1476,8 +1476,12 @@ def methodDefs(self):
return '\n\n'.join(methodDefs)
def attributes(self):
- attribs = [self.setting('indentationStep') + str(attrib)
- for attrib in self._generatedAttribs ]
+ try:
+ attribs = [self.setting('indentationStep') + str(attrib)
+ for attrib in self._generatedAttribs ]
+ except UnicodeEncodeError:
+ attribs = [self.setting('indentationStep') + unicode(attrib)
+ for attrib in self._generatedAttribs ]
return '\n\n'.join(attribs)
class AutoClassCompiler(ClassCompiler):