Author: ianb
Date: 2006-10-10 14:01:44 -0600 (Tue, 10 Oct 2006)
New Revision: 2001

Modified:
   FormEncode/trunk/docs/news.txt
   FormEncode/trunk/formencode/schema.py
   FormEncode/trunk/formencode/validators.py
Log:
Fix #1559918 Schema fails to accept unicode errors

Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt      2006-10-10 19:57:36 UTC (rev 2000)
+++ FormEncode/trunk/docs/news.txt      2006-10-10 20:01:44 UTC (rev 2001)
@@ -9,6 +9,9 @@
 * Fixes `#1457145: Fails on URLs with port numbers
   
<http://sourceforge.net/tracker/index.php?func=detail&aid=1457145&group_id=91231&atid=596416>`_
 
+* Fixes `#1559918 Schema fails to accept unicode errors
+  
<http://sourceforge.net/tracker/index.php?func=detail&aid=1559918&group_id=91231&atid=596416>`_
+
 0.6
 ---
 

Modified: FormEncode/trunk/formencode/schema.py
===================================================================
--- FormEncode/trunk/formencode/schema.py       2006-10-10 19:57:36 UTC (rev 
2000)
+++ FormEncode/trunk/formencode/schema.py       2006-10-10 20:01:44 UTC (rev 
2001)
@@ -309,7 +309,7 @@
             ['%s' % (format_compound_error(value, indent=indent))
              for value in v
              if value is not None])
-    elif isinstance(v, str):
+    elif isinstance(v, basestring):
         return v
     else:
         assert 0, "I didn't expect something like %s" % repr(v)

Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py   2006-10-10 19:57:36 UTC (rev 
2000)
+++ FormEncode/trunk/formencode/validators.py   2006-10-10 20:01:44 UTC (rev 
2001)
@@ -1509,8 +1509,9 @@
         if isinstance(upload, cgi.FieldStorage):
             filename = upload.filename
             content = upload.value
-        elif isinstance(upload, str) and upload:
+        elif isinstance(upload, basestring) and upload:
             filename = None
+            # @@: Should this encode upload if it is unicode?
             content = upload
         if not content and static:
             filename, content = static.split(None, 1)


-------------------------------------------------------------------------
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
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs

Reply via email to