Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
wants to merge 2 commits into from

2 participants

@WillSams

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.

WillSams and others added some commits
@WillSams WillSams 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
Will Sams Made change based on comment from Jeff Hardy. 4040ffa
@mitsuhiko
Owner

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

@mitsuhiko mitsuhiko closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 12, 2012
  1. @WillSams

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

    WillSams authored
    IronPython fails to correctly reference unicode strings containing non-ASCII characters.  This covers issue #146.
Commits on Oct 15, 2012
  1. Made change based on comment from Jeff Hardy.

    Will Sams authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 2 deletions.
  1. +1 −2  jinja2/runtime.py
View
3  jinja2/runtime.py
@@ -15,7 +15,6 @@
from jinja2.exceptions import UndefinedError, TemplateRuntimeError, \
TemplateNotFound
-
# these variables are exported to the template runtime
__all__ = ['LoopContext', 'TemplateReference', 'Macro', 'Markup',
'TemplateRuntimeError', 'missing', 'concat', 'escape',
@@ -25,7 +24,7 @@
#: the name of the function that is used to convert something into
#: a string. 2to3 will adopt that automatically and the generated
#: code can take advantage of it.
-to_string = unicode
+to_string = unicode if sys.platform != 'cli' else lambda x: unicode(x)
#: the identity function. Useful for certain things in the environment
identity = lambda x: x
Something went wrong with that request. Please try again.