#60 cheetah 0.9.18


Python 2.3.5 (#2, May 4 2005, 08:51:39)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import psyco
>>> psyco.full()
>>> from Cheetah.Template import Template
>>> print Template("""
... #for $i in range(10)
... $i
... #end for
... """)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<string>", line 28, in respond
NameMapper.NotFound: cannot find 'i'


  • william dodé

    william dodé - 2005-09-30
    • priority: 5 --> 7
  • william dodé

    william dodé - 2005-09-30

    Logged In: YES

    The bug is with 1.4 and current svn sources

  • Armin Rigo

    Armin Rigo - 2005-09-30

    Logged In: YES

    Cheetah is using frame hackery to access the caller frame's variables. It is a known limitation of Psyco not to support this. What took me longer to figure out is why Psyco didn't trigger a warning or an error that would have made this clear. The answer is that Cheetah has an optional C extension module for speed to resolve the names; if this C "_namemapper.so" is removed, then its pure Python equivalent is used, and we get a (known) crash in inspect.stack().

    There is no workaround for this, you can't use Psyco on the __repr__() of Templates, sorry. For reference see http://psyco.sf.net/psycoguide/bugs.html.

  • Armin Rigo

    Armin Rigo - 2005-09-30
    • status: open --> closed-wont-fix

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks