[Checkins] SVN: five.pt/trunk/ Avoid duplicate decoding of Python expressions.

Malthe Borch mborch at gmail.com
Thu Dec 8 12:32:52 UTC 2011


Log message for revision 123626:
  Avoid duplicate decoding of Python expressions.

Changed:
  U   five.pt/trunk/CHANGES.txt
  U   five.pt/trunk/src/five/pt/expressions.py

-=-
Modified: five.pt/trunk/CHANGES.txt
===================================================================
--- five.pt/trunk/CHANGES.txt	2011-12-07 21:16:37 UTC (rev 123625)
+++ five.pt/trunk/CHANGES.txt	2011-12-08 12:32:51 UTC (rev 123626)
@@ -1,6 +1,12 @@
 Changelog
 =========
 
+In next release ...
+
+- Avoid duplicate HTML decoding. This fixes an issue which was
+  introduced because newer Chameleon releases decode all expression
+  inputs by default.
+
 2.2.0 (2011-10-10)
 ~~~~~~~~~~~~~~~~~~
 

Modified: five.pt/trunk/src/five/pt/expressions.py
===================================================================
--- five.pt/trunk/src/five/pt/expressions.py	2011-12-07 21:16:37 UTC (rev 123625)
+++ five.pt/trunk/src/five/pt/expressions.py	2011-12-08 12:32:51 UTC (rev 123626)
@@ -27,7 +27,6 @@
 from chameleon.astutil import Symbol
 from chameleon.astutil import Static
 from chameleon.codegen import template
-from chameleon.utils import decode_htmlentities
 from sourcecodegen import generate_code
 
 from z3c.pt import expressions
@@ -223,8 +222,7 @@
         return node
 
     def parse(self, string):
-        decoded = decode_htmlentities(string)
-        encoded = decoded.encode('utf-8')
+        encoded = string.encode('utf-8')
         node = ast24_parse(encoded, 'eval').node
         MutatingWalker.walk(node, self.rm)
         string = generate_code(node)



More information about the checkins mailing list