aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthis Thorade <matthis.thorade@gmail.com>2015-01-07 14:42:14 +0000
committerMatthis Thorade <matthis.thorade@gmail.com>2015-01-07 14:42:14 +0000
commit3499108012dd84144926d930ab58b5e3b5f296e9 (patch)
tree661e629c4b4080606e31d6b539bad56d717170b0
parent092b66b3ea510ddbc06e9b867a18988bffb5374b (diff)
downloadexternal_python_mako-3499108012dd84144926d930ab58b5e3b5f296e9.tar.gz
external_python_mako-3499108012dd84144926d930ab58b5e3b5f296e9.tar.bz2
external_python_mako-3499108012dd84144926d930ab58b5e3b5f296e9.zip
unicode.rst edited online with Bitbucket,
related to #234
-rw-r--r--doc/build/unicode.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/build/unicode.rst b/doc/build/unicode.rst
index 16eb161..1ba364e 100644
--- a/doc/build/unicode.rst
+++ b/doc/build/unicode.rst
@@ -229,7 +229,7 @@ supported codec:
mylookup = TemplateLookup(directories=['/docs'], output_encoding='utf-8', encoding_errors='replace')
mytemplate = mylookup.get_template("foo.txt")
- print mytemplate.render()
+ print(mytemplate.render())
:meth:`~.Template.render` will return a ``bytes`` object in Python 3 if an output
encoding is specified. By default it performs no encoding and
@@ -240,14 +240,14 @@ returns a native string.
.. sourcecode:: python
- print mytemplate.render_unicode()
+ print(mytemplate.render_unicode())
The above method disgards the output encoding keyword argument;
you can encode yourself by saying:
.. sourcecode:: python
- print mytemplate.render_unicode().encode('utf-8', 'replace')
+ print(mytemplate.render_unicode().encode('utf-8', 'replace'))
Buffer Selection
----------------
@@ -289,7 +289,7 @@ Python. For these users, assuming they're sticking with Python
from mako.template import Template
t = Template("drôle de petite voix m’a réveillé.", disable_unicode=True, input_encoding='utf-8')
- print t.code
+ print(t.code)
The ``disable_unicode`` mode is strictly a Python 2 thing. It is
not supported at all in Python 3.