Hi Massimo,
I propose changing lines 282-290 to
if delimiters != self.default_delimiters:
escaped_delimiters = (escape(delimiters[0]),
escape(delimiters[1]))
self.r_tag = compile(r'(%s.*?%s)' % escaped_delimiters, DOTALL)
elif hasattr(context.get('response', None), 'delimiters'):
if context['response'].delimiters != self.default_delimiters:
delimiters = context['response'].delimiters
escaped_delimiters = (
escape(delimiters[0]),
escape(delimiters[1]))
self.r_tag = compile(r'(%s.*?%s)' % escaped_delimiters,
DOTALL)
On Thursday, September 4, 2014 6:48:13 PM UTC+8, Jonathan New wrote:
>
> Unfortunately, the latest patch (Version
> 2.9.6-stable+timestamp.2014.09.02.01.57.55) doesn't solve the problem.
>
> line 282:
> if delimiters is None:
> delimiters = context.get('response', {})\
> .get('app_settings',{}).get('template_delimiters')
>
> However, delimiters will never be None. It will always have the default
> value of ('{{', '}}')
>
>
> The pre-2.9.6 code works because line 286 checks for existence of
> response.delimiter:
>
> if delimiters != self.default_delimiters:
> escaped_delimiters = (escape(delimiters[0]),
> escape(delimiters[1]))
> self.r_tag = compile(r'(%s.*?%s)' % escaped_delimiters, DOTALL)
> el*if hasattr(context.get('response', None), 'delimiters')*:
> if context['response'].delimiters != self.default_delimiters:
> escaped_delimiters = (
> escape(context['response'].delimiters[0]),
> escape(context['response'].delimiters[1]))
> self.r_tag = compile(r'(%s.*?%s)' % escaped_delimiters,
> DOTALL)
>
>
>
> On Wednesday, September 3, 2014 9:29:50 PM UTC+8, Massimo Di Pierro wrote:
>>
>> This will be fixed today with a new emergency release.
>>
>> On Wednesday, 3 September 2014 05:02:15 UTC-5, Jonathan New wrote:
>>>
>>> In prior web2py versions, we can change the template delimiters by
>>> response.delimiters
>>> = ('<?', '?>')
>>>
>>> With 2.9.6, gluon/template.py in lines 282-290 were changed such that
>>> response.delimiters doesn't work.
>>> I tried response.app_settings = {'template_delimiters': ('<?', '?>')}
>>> which the new code seems to refer to, also doesn't work
>>>
>>> BTW, line 286 also have typo error: escaped_delimiters = (escape(
>>> elimiters[0])
>>>
>>>
>>>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.