diff options
Diffstat (limited to 'BUGS')
-rw-r--r-- | BUGS | 86 |
1 files changed, 86 insertions, 0 deletions
@@ -0,0 +1,86 @@ +Known Bugs in Cheetah +-------------------------- +See the file CHANGES for a list of bugs that have been resolved. + +Developers: if a bug was significant and affected a released version of +Cheetah, be sure to note its fix in the CHANGES file! + + +Compiler forgets commas +======================= +Affects Cheetah 0.9.14, CVS and possibly earlier. +- fix bug in Parser.getDefArgList() that is mucking up lists where the comma has + been forgotten: + + > #cache timer='.5m' id='cache1' + > This is a cached region. $voom + > #end cache + > + > the error is: + > + > "/local/opt/Python/lib/python2.2/site-packages/Webware/Cheetah/Compiler.py", + > line 102, in genCacheInfoFromArgList + > val = self.genTimeInterval(val) + > File + > "/local/opt/Python/lib/python2.2/site-packages/Webware/Cheetah/Compiler.py", + > line 75, in genTimeInterval + > interval = float(timeString)*60 + > ValueError: invalid literal for float(): .5m' id'cache1 + > + > + > Running under pdb shows that Parser.getDefArgList() returned: + > "30m' id'cache1" . + + + + + +IOError shouldn't be changed to NameMapper.NotFound +===================================================================== +Reproducable in CVS 2002-09-11 / Python 2.2 and +Cheetah 0.9.14 / Python 2.2.1. + +I think this behavior is incorrect; it's deceptive. I suspect that it's +coming from Cheetah, since Python's own getattr() allows the IOError to +rise up to the top. Perhaps NameMapper has an overly aggressive +"except:" somewhere. +- Chuck Esterbrook <ChuckEsterbrook@StockAlerts.com> + +I tried adding an empty "raise" after every "except:" in NameMapper.py, +but was unable to change the NotFound to IOError. Ergo, the change is +happening somewhere else. Decide whether this behavior is a bug: +t'ain't necessarily so just because Chuck says it is. +- Mike Orr <iron@mso.oz.net> + +#### BEGIN notFoundErrorDemo.py +#!/usr/bin/env python +from Cheetah.Template import Template as T + +class obj: + + def __getattr__(self, name): + if name.startswith('__') or name.startswith('get_'): + raise AttributeError, name + meth = getattr(self, 'get_'+name, None) + if meth: + return meth() + else: + raise AttributeError, name + + def get_baz(self): + raise IOError + + #def baz(self): + # raise IOError + +x = obj() + +if 0: + # raises IOError, as expected + print getattr(x, 'baz') +else: + # should raise IOError + # instead, raises: NameMapper.NotFound: baz + t = T('$baz', searchList=[x]) + print str(t) +#### END notFoundErrorDemo.py |