Plone 4.3.3 and Chameleon engine (five.pt)

Hello Community,

we started using Chameleon engine (or just five.pt) recently. I already knew, that Chameleon is a bit stricter in terms of parsing TAL, but I recently stumbled on a problem, which should be no problem under my impression.

In short, this particular snippet is working, where as the other is not:

<!-- Works -->
<tal:content tal:define="foo string:bar;">
</tal:content>

<!-- Works not -->
<tal:content
tal:define="foo string:bar;">
</tal:content>

Both cases should be valid xhtml, right? The latter moved the attribute into the next line and I get the exception message "unexpected end tag".

I this an issue between five.pt and Plone 4.3.3 or due to the new "strictness" introduced with five.pt?

best regards, Paul

In case this is helpful, here are the versions my current buildout is using:

[versions]
Babel = 1.3
Chameleon = 2.18
Products.PDBDebugMode = 1.3.1
Products.PythonField = 1.1.3
Products.TALESField = 1.1.3
Products.TemplateFields = 1.2.5
Twisted = 14.0.2
five.pt = 2.2.2
ipdb = 0.8
ipython = 2.3.0
plone.app.async = 1.6
plone.app.debugtoolbar = 1.0
plone.event = 1.1
plone.formwidget.datetime = 1.0
plone.formwidget.recurrence = 1.2.5
plone.recipe.command = 1.1
plone.recipe.precompiler = 0.6
sourcecodegen = 0.6.14
z3c.jbot = 0.7.2
z3c.pt = 2.2.3
zc.dict = 1.2.1
zc.twist = 1.3.1
zope.bforest = 1.2

# Required by:
# plone.app.event==1.0.5
Products.DateRecurringIndex = 2.1

# Required by:
# tud.addons.PloneFormGenBase==1.0
Products.PloneFormGen = 1.7.15

# Required by:
# collective.cron==2.7
collective.autopermission = 1.0b2

# Required by:
# tud.addons.newsarchive==1.0
# tud.addons.webcms==0.1dev
# tud.profiles.webcms==0.1dev
collective.cron = 2.7

# Required by:
# plone.app.event==1.0.5
collective.elephantvocabulary = 0.2.4

# Required by:
# collective.ckeditor==4.3.0b3.dev0
collective.plonefinder = 1.0.7

# Required by:
# collective.ckeditor==4.3.0b3.dev0
# collective.plonefinder==1.0.7
collective.quickupload = 1.6.5

# Required by:
# tud.addons.webcms==0.1dev
# tud.profiles.webcms==0.1dev
collective.zipfiletransport = 3.2.3

# Required by:
# collective.cron==2.7
croniter = 0.3.5

# Required by:
# collective.ckeditor==4.3.0b3.dev0
demjson = 2.2.2

# Required by:
# plone.app.event==1.0.5
icalendar = 3.8.3

# Required by:
# zc.z3monitor==0.8.0
mock = 1.0.1

# Required by:
# collective.quickupload==1.6.5
ua-parser = 0.3.5

# Required by:
# zc.async==1.5.4
uuid = 1.30

# Required by:
# plone.app.async==1.6
zc.async = 1.5.4

# Required by:
# plone.app.async==1.6
# zc.z3monitor==0.8.0
zc.monitor = 0.3.1

# Required by:
# zc.monitor==0.3.1
zc.ngi = 2.0.1

# Required by:
# zc.async==1.5.4
zc.queue = 1.3

# Required by:

# plone.app.async==1.6
zc.z3monitor = 0.8.0
1 Like

is this working?

<tal:content
 tal:define="foo string:bar;">

Note the space before tal:define, your example is one string <tal:contenttal:define= etc

Sadly, I get the same result even with those spaces before tal:define. I also used other tags like span.

So this is failing? when using span

<span
 tal:define="foo string:bar;" />

Yes.

Can you post your full error log?

I will post more tomorrow.

I was trying to create a minimal example to demonstrate that bug. But it does seem to work. Seems I need to investigate closer here. However, here is the error log:

Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module Products.PDBDebugMode.runcall, line 70, in pdb_runcall
Module ZPublisher.Publish, line 48, in call_object
Module tud.addons.box.browser.boxcontentbase_views, line 22, in __call__
Module Products.Five.browser.pagetemplatefile, line 125, in __call__
Module Products.Five.browser.pagetemplatefile, line 59, in __call__
Module zope.pagetemplate.pagetemplate, line 126, in pt_render
Warning: Compilation failed
Warning: chameleon.exc.ParseError: Unexpected end tag. - String: "</tal:content>" - Filename: /vmytemplate.pt - Location: (line 47: col 8)
PTRuntimeError: ['Compilation failed', 'chameleon.exc.ParseError: Unexpected end tag.\n\n - String: "</tal:content>"\n - Filename: /mytemplate.pt \n - Location: (line 47: col 8)']

As a side node: Could it be, that "translate" cant be overriden in chameleon? See minimal example and stacktrace here: http://pastie.org/private/gzqxbugtyva7ssqg2qw6lq

i18n:translate so yes please use something other then translate

Follow up: The problem seems to be occuring when using windows line endings (CLRF). When using LF, the very same template works like a charm.

1 Like

For reference, this is bug: https://github.com/malthe/chameleon/issues/174