GithubHelp home page GithubHelp logo

SyntaxError: invalid syntax about chameleon HOT 3 CLOSED

malthe avatar malthe commented on June 6, 2024
SyntaxError: invalid syntax

from chameleon.

Comments (3)

malthe avatar malthe commented on June 6, 2024

Must be a bug in http://pypi.python.org/pypi/sourcecodegen (which generates Python source code from a Python 2.4 AST in order for us to use RestrictedPython).

How can I reproduce this locally? Is the an open-source package you're trying to use?

from chameleon.

rpatterson avatar rpatterson commented on June 6, 2024

Oh, sorry, missed the request for more info.

No, unfortunately, this is in client code. I have two tests that fail with this error. Both of them are testbrowser tests that create a custom AT content type both of which use the default AT view and edit templates.

Some time with pdb shows me that this error comes from using Products.ATBackRef: https://dev.plone.org/archetypes/browser/MoreFieldsAndWidgets/ATBackRef/trunk/src/Products/ATBackRef/skins/ATBackRef/backreferencebrowserwidget.pt?rev=13257#L57

tal:define="foo python:refs.sort(lambda x,y: cmp(x.order, y.order))"

from chameleon.

rpatterson avatar rpatterson commented on June 6, 2024

I worked around this:

https://dev.plone.org/archetypes/changeset/13739

But it sure looks like Chameleon might not support lambdas. I did a grep of all my client project full omelets and didn't find any other cases of lambdas in templates. Still, I'm sure ATBackRef isn't the only one which did. So this should probably be fixed or lambdas should be documented as an exception to Chameleon's claim of compatibility.

from chameleon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.