From 512b41cc9c23c5735452f456041105ad6d17ed32 Mon Sep 17 00:00:00 2001 From: Federico Di Gregorio Date: Thu, 20 Oct 2011 09:52:22 +0200 Subject: [PATCH] Fix encoding when Zope explicitly pass empty "enc" argument --- ZPsycopgDA/db.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ZPsycopgDA/db.py b/ZPsycopgDA/db.py index 2f7040d4..fe27931c 100644 --- a/ZPsycopgDA/db.py +++ b/ZPsycopgDA/db.py @@ -39,7 +39,10 @@ class DB(TM, dbi_db.DB): self.dsn = dsn self.tilevel = tilevel self.typecasts = typecasts - self.encoding = enc + if enc is None or enc == "": + self.encoding = "utf-8" + else: + self.encoding = enc self.failures = 0 self.calls = 0 self.make_mappings()