From 2391e6d67a87f923063f6bdb61097a9f015031fd Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 2 Mar 2006 00:06:53 +0000 Subject: [PATCH] got unicode to do None... --- lib/sqlalchemy/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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') -- 2.47.2