[Zope-Checkins] CVS: Zope/lib/python/Shared/DC/ZRDB - sqlvar.py:1.14

Christian Zagrodnick cz@gocept.com
Wed, 19 Mar 2003 15:21:25 -0500


Update of /cvs-repository/Zope/lib/python/Shared/DC/ZRDB
In directory cvs.zope.org:/tmp/cvs-serv14460

Modified Files:
	sqlvar.py 
Log Message:
- converting value only to str if it is neither str already or unicode. The
  underlying database adapter should convert a unicode to the encoding the
  database expects.


=== Zope/lib/python/Shared/DC/ZRDB/sqlvar.py 1.13 => 1.14 ===
--- Zope/lib/python/Shared/DC/ZRDB/sqlvar.py:1.13	Wed Aug 14 17:50:59 2002
+++ Zope/lib/python/Shared/DC/ZRDB/sqlvar.py	Wed Mar 19 15:21:23 2003
@@ -123,7 +123,8 @@
                 raise ValueError, (
                     'Invalid floating-point value for <em>%s</em>' % name)
         else:
-            v=str(v)
+            if not isinstance(v, (str, unicode)):
+                v=str(v)
             if not v and t=='nb':
                 if args.has_key('optional') and args['optional']:
                     return 'null'