From f91df04b05e9cfcd043b94fafbaf0eed16774379 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 29 May 2013 18:29:12 -0400 Subject: - repair for py3k - fix test --- lib/sqlalchemy/dialects/postgresql/psycopg2.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/dialects/postgresql/psycopg2.py') diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index 037a06418..c796c99c7 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -393,8 +393,13 @@ class PGDialect_psycopg2(PGDialect): hstore_oids = self._hstore_oids(conn) if hstore_oids is not None: oid, array_oid = hstore_oids - extras.register_hstore(conn, oid=oid, array_oid=array_oid, + if util.py2k: + extras.register_hstore(conn, oid=oid, + array_oid=array_oid, unicode=True) + else: + extras.register_hstore(conn, oid=oid, + array_oid=array_oid) fns.append(on_connect) if fns: -- cgit v1.2.1