- filters.Decode filter can also accept a non-basestring object and will call str() + unicode() on it [ticket:47]
diff --git a/CHANGES b/CHANGES index b691827..cfc7185 100644 --- a/CHANGES +++ b/CHANGES
@@ -1,3 +1,7 @@ +0.1.9 +- filters.Decode filter can also accept a non-basestring +object and will call str() + unicode() on it [ticket:47] + 0.1.8 - variable names declared in render methods by internal codegen prefixed by "__M_" to prevent name collisions
diff --git a/lib/mako/filters.py b/lib/mako/filters.py index 0f2b87c..68acd9e 100644 --- a/lib/mako/filters.py +++ b/lib/mako/filters.py
@@ -44,9 +44,10 @@ def decode(x): if isinstance(x, unicode): return x - if not isinstance(x, str): - return str(x) - return unicode(x, encoding=key) + elif not isinstance(x, str): + return unicode(str(x), encoding=key) + else: + return unicode(x, encoding=key) return decode decode = Decode()
diff --git a/setup.py b/setup.py index 68d30c0..4281cf7 100644 --- a/setup.py +++ b/setup.py
@@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.1.8' +version = '0.1.9' setup(name='Mako', version=version,