added support for unicode identifiers
--HG--
branch : trunk
diff --git a/jinja2/debug.py b/jinja2/debug.py
index 9209054..cfc2bc8 100644
--- a/jinja2/debug.py
+++ b/jinja2/debug.py
@@ -12,6 +12,7 @@
"""
import sys
from types import CodeType
+from jinja2.compiler import unmask_identifier
def translate_exception(exc_info):
@@ -66,7 +67,13 @@
locals = {}
for name, value in real_locals.iteritems():
if name.startswith('l_'):
- locals[name[2:]] = value
+ try:
+ locals[str(unmask_identifier(name))] = value
+ except UnicodeError:
+ # bummer. someone actually used an unicode identifier.
+ # there is no way this can be added back into the python
+ # layer with python < 3. we have to ignore it...
+ pass
# if there is a local called __jinja_exception__, we get
# rid of it to not break the debug functionality.