On Feb 27, 2007, at 11:18 AM, Daniel Krech wrote:

I'm hitting to following issue running some code that worked fine using earlier versions of Kid. Any one else hitting this?


File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/kid-0.9.5-py2.5.egg/kid/__init__.py", line 272, in write
    raise_template_error(module=self.__module__)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/kid-0.9.5-py2.5.egg/kid/codewriter.py", line 94, in raise_template_error
    encoding = mod.encoding
AttributeError: 'module' object has no attribute 'encoding'

Just wanted to follow up since I have a bit more info re: this issue.

Looks like I can no longer hook into kid at such a low level (was using compile from kid.compiler before). I'm now hooking into kid by paralleling load_template from kid/__init__.py and things are once again working as they where.

-        code = redfoot._kid_cache.get(value)
-        if code is None:
- code = kid_compiler.compile(StringIO(value.encode ("utf-8")), filename=unicode(uri), encoding="utf-8")
-            redfoot._kid_cache[value] = code
-        exec code in context
+        mod = redfoot._kid_cache.get(value)
+        if mod is None:
+ mod = kid_module.load_template(StringIO(value.encode ("utf-8")), name=unicode(uri), encoding="utf-8")
+            redfoot._kid_cache[value] = mod
+        t = mod.Template(**context)

Daniel Krech, http://eikeon.com/



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
kid-template-discuss mailing list
kid-template-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss

Reply via email to