From: Mike Bayer Date: Thu, 2 Mar 2006 00:06:53 +0000 (+0000) Subject: got unicode to do None... X-Git-Tag: rel_0_1_3~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2391e6d67a87f923063f6bdb61097a9f015031fd;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git got unicode to do None... --- diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py index 70d124ec86..fcd416398d 100644 --- a/lib/sqlalchemy/types.py +++ b/lib/sqlalchemy/types.py @@ -95,12 +95,12 @@ class String(NullTypeEngine): else: return self def convert_bind_param(self, value, engine): - if not engine.convert_unicode or not isinstance(value, unicode): + if not engine.convert_unicode or value is None or not isinstance(value, unicode): return value else: return value.encode('utf-8') def convert_result_value(self, value, engine): - if not engine.convert_unicode or isinstance(value, unicode): + if not engine.convert_unicode or value is None or isinstance(value, unicode): return value else: return value.decode('utf-8')