Skip to content
This repository

Update to jinja2/runtime.py to handle IronPython unicode strings issue. #157

Closed
wants to merge 2 commits into from

2 participants

Will Sams Armin Ronacher
Will Sams

IronPython fails to correctly reference unicode strings containing non-ASCII characters.  This covers issue #146.

Please dismiss the earlier request. Committed a test copy instead of the working copy earlier.

and others added some commits October 12, 2012
Will Sams Update to jinja2/runtime.py to handle IronPython unicode strings issue.
IronPython fails to correctly reference unicode strings containing non-ASCII characters.  This covers issue #146.
b9ced43
Made change based on comment from Jeff Hardy. 4040ffa
Armin Ronacher
Owner

How does this fix anything? (I don't use IronPython)

Armin Ronacher mitsuhiko closed this May 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 2 authors.

Oct 12, 2012
Will Sams Update to jinja2/runtime.py to handle IronPython unicode strings issue.
IronPython fails to correctly reference unicode strings containing non-ASCII characters.  This covers issue #146.
b9ced43
Oct 15, 2012
Made change based on comment from Jeff Hardy. 4040ffa
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 2 deletions. Show diff stats Hide diff stats

  1. 3  jinja2/runtime.py
3  jinja2/runtime.py
@@ -15,7 +15,6 @@
15 15
 from jinja2.exceptions import UndefinedError, TemplateRuntimeError, \
16 16
      TemplateNotFound
17 17
 
18  
-
19 18
 # these variables are exported to the template runtime
20 19
 __all__ = ['LoopContext', 'TemplateReference', 'Macro', 'Markup',
21 20
            'TemplateRuntimeError', 'missing', 'concat', 'escape',
@@ -25,7 +24,7 @@
25 24
 #: the name of the function that is used to convert something into
26 25
 #: a string.  2to3 will adopt that automatically and the generated
27 26
 #: code can take advantage of it.
28  
-to_string = unicode
  27
+to_string = unicode if sys.platform != 'cli' else lambda x: unicode(x)
29 28
 
30 29
 #: the identity function.  Useful for certain things in the environment
31 30
 identity = lambda x: x
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.