On Fri, Dec 23, 2005 at 03:59:03PM -0500, Kevin Dangoor wrote:
> Some Windows users have been complaining about endless loops, and one
> tracked it down to TemplatePath.relativize (which does, in fact, have
> a while 1 in it). In looking at that method, I'm not entirely certain
> what the point is... if you're looking for a file that is relative to
> another one, can't you just normpath(join(dirname(file), path))? why
> does it need to check with the paths set in the TemplatePath?

I think you are right. The call to TemplatePath.relativize should be
something simpler. It is possible in the current implementation for
the wrong file to be found. See
kid.test.test_templatepath.Xtest_bad_relative for an example of
this. I have created a patch for this, but would like some input
before I commit it. The patch has been attached to ticket #110[0].

Another thing I noticed is that the cache was not working. I cannot
see place where it is being set. Even if it were working I am not
sure this is the right place for a cache. This class manages the
template path and should not be burdened by this extra
responsibility. A better place for a cache would be the load*
functions right?

David

[0] http://lesscode.org/projects/kid/ticket/110

-- 
GPG keyID #6272EDAF on http://pgp.mit.edu
Key fingerprint = 8BAA 7E11 8856 E148 6833  655A 92E2 3E00 6272 EDAF

Attachment: pgp80fiwv9t1Q.pgp
Description: PGP signature

Reply via email to