Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#60 cheetah 0.9.18

closed-wont-fix
nobody
7
2005-09-30
2005-09-29
william dodé
No

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'
>>>

Discussion

  • william dodé
    william dodé
    2005-09-30

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

    Logged In: YES
    user_id=19942

    The bug is with 1.4 and current svn sources

     
  • Armin Rigo
    Armin Rigo
    2005-09-30

    Logged In: YES
    user_id=4771

    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