summaryrefslogtreecommitdiff
path: root/mako/template.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-02-20 19:16:16 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-02-20 19:16:16 -0500
commit4737c269f5658fdab4190504cd5744e95bae1688 (patch)
tree5fe1c5244f4e7d263e7d564f924797062859d9c5 /mako/template.py
parentbdbe02356b6fa9acb6739879ead25a54e2c62ecb (diff)
downloadmako-4737c269f5658fdab4190504cd5744e95bae1688.tar.gz
- use inlined getargspec
- The "output encoding" now defaults to "ascii", whereas previously it was set to None. This has the effect of FastEncodingBuffer being used internally by default when render() is called, instead of cStringIO or StringIO, which are slower, but allow bytestrings with unknown encoding to pass right through. It is of course not recommended to use bytestrings of unknown encoding. Usage of the "disable_unicode" mode also requires that output_encoding be set to None.
Diffstat (limited to 'mako/template.py')
-rw-r--r--mako/template.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mako/template.py b/mako/template.py
index 5c67b14..f93be79 100644
--- a/mako/template.py
+++ b/mako/template.py
@@ -127,7 +127,7 @@ class Template(object):
format_exceptions=False,
error_handler=None,
lookup=None,
- output_encoding=None,
+ output_encoding='ascii',
encoding_errors='strict',
module_directory=None,
cache_type=None,
@@ -164,7 +164,10 @@ class Template(object):
raise exceptions.UnsupportedError(
"Mako for Python 3 does not "
"support disabling Unicode")
-
+ elif output_encoding and disable_unicode:
+ raise exceptions.UnsupportedError(
+ "output_encoding must be set to "
+ "None when disable_unicode is used.")
if default_filters is None:
if util.py3k or self.disable_unicode:
self.default_filters = ['str']