Author: ianb
Date: 2006-05-12 14:10:59 -0600 (Fri, 12 May 2006)
New Revision: 1766

Modified:
   FormEncode/trunk/formencode/schema.py
Log:
Fix for TG internationalization from Max Ischenko

Modified: FormEncode/trunk/formencode/schema.py
===================================================================
--- FormEncode/trunk/formencode/schema.py       2006-05-12 20:09:08 UTC (rev 
1765)
+++ FormEncode/trunk/formencode/schema.py       2006-05-12 20:10:59 UTC (rev 
1766)
@@ -289,7 +289,14 @@
 
 def format_compound_error(v, indent=0):
     if isinstance(v, Exception):
-        return str(v)
+        try:
+            return str(v)
+        except UnicodeDecodeError:
+            # There doesn't seem to be a better way to get a str()
+            # version if possible, and unicode() if necessary, because
+            # testing for the presence of a __unicode__ method isn't
+            # enough
+            return unicode(v)
     elif isinstance(v, dict):
         l = v.items()
         l.sort()



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs

Reply via email to