Hi there,

Malthe Borch wrote:
> On 27 February 2010 12:10, Uli Fouquet <u...@gnufix.de> wrote:
> > While trying to make megrok.chameleon compatible with zopetoolkit and
> > groktoolkit package versions, I noticed that latest z3c.pt (1.1.0) and
> > trunk are not completely compatible with Chameleon >= 1.1.0. The tests
> > fail.
> Do you think you can find time to try and reproduce this in straight 
> Chameleon?

Sure, the following doctest example added to core/codegen.txt passes
with Chameleon 1.0.8::

  Syntax extension: ``econtext`` references

    >>> suite = Suite("""\
    ... result = _path(options, True, 'test')
    ... """)
    >>> suite.source
    "result = econtext['_path'](econtext['options'], True, 'test')\n"

But with Chameleon trunk gives::

  File "...chameleon/trunk/src/chameleon/core/codegen.txt", line 48, in 
  Failed example:
      "result = econtext['_path'](econtext['options'], True, 'test')\n"
      "result = econtext['econtext']['_path'](econtext['econtext']['options'], 
True, 'test')\n"


> >    'options/test'
> >    result = econtext['econtext']['_path'](
> >               econtext['econtext']['options'],
> >               econtext['econtext']['request'], True, 'test')
> Seems like the code that does the name transformation
> (codegen.py:visit_Name) should include ``econtext`` to the list of
> globally known symbols.

Ah, I see. Thanks for the hint! Looks like this is really the crucial

When I add ``'econtext'`` to ``CONSTANTS`` (just to inject it somewhere,
probably not the right place), all tests pass, including the snippet
above. This is true for both versions, the current trunk and 1.0.8 :-)


Thanks for looking into this! If you think the mentioned behaviour is
really a bug in Chameleon, I'd be glad to assist in fixing it.

Best regards,


Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Repoze-dev mailing list

Reply via email to