template TypeError: 'bool' object is not callable.

1,127 views
Skip to first unread message

Johan Andersson

unread,
Jul 12, 2012, 7:04:40 AM7/12/12
to python-tornado
Hi.

When i have autoescape set to False or True in settings i get:
TypeError: 'bool' object is not callable
but when i remove that line i dont get that error.

http://14d7faad54400aab.paste.se/ stacktrace

http://3dc82066e0aa8050.paste.se/ base.html

http://755757e64ceb7ea6.paste.se/ home.html

What did i do wrong ? i dont see any obvious.

Im using python 2.7.2 and latest tornado from git 00688f9a3000b8


cheers
--
Johan Andersson

Phil Whelan

unread,
Jul 12, 2012, 5:38:01 PM7/12/12
to python-...@googlegroups.com
Hi Johan,

On 2012-07-12, at 8:04 PM, Johan Andersson wrote:

Hi.

When i have autoescape set to False or True in settings i get:
TypeError: 'bool' object is not callable
but when i remove that line i dont get that error.

http://14d7faad54400aab.paste.se/ stacktrace

http://3dc82066e0aa8050.paste.se/  base.html

http://755757e64ceb7ea6.paste.se/  home.html

What did i do wrong ? i dont see any obvious.

      File "home_html.generated.py", line 8, in _execute
        _tmp = _utf8(False(_tmp))  # base.html:5
You're calling False here with parentheses, as if it were a function.

Cheers,
Phil

Jorge Puente Sarrín

unread,
Jul 12, 2012, 5:43:04 PM7/12/12
to python-...@googlegroups.com
Can you share the call to render function from RequestHandler?

2012/7/12 Johan Andersson <j...@i19.se>



--
Atte.
Jorge Puente Sarrín.

Ben Darnell

unread,
Jul 14, 2012, 12:42:06 PM7/14/12
to python-...@googlegroups.com
Autoescape is not a boolean setting - to disable autoescaping, set it
to None; to enable it, set it to the name of a function such as
"xhtml_escape" (this name will be evaluated in the template namespace
so if you're using a non-standard escaping function be sure to pass it
as a kwarg to render() or generate()).

-Ben
Reply all
Reply to author
Forward
0 new messages