summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqlalchemy/engine/default.py6
-rw-r--r--test/engine/execute.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py
index 1f2001e05..af1e42f38 100644
--- a/lib/sqlalchemy/engine/default.py
+++ b/lib/sqlalchemy/engine/default.py
@@ -180,8 +180,10 @@ class DefaultExecutionContext(base.ExecutionContext):
return params
else:
def proc(d):
- if d is None:
- return None
+ # sigh, sometimes we get positional arguments with a dialect
+ # that doesnt specify positional (because of execute_text())
+ if not isinstance(d, dict):
+ return d
return dict([(k.encode(self.dialect.encoding), d[k]) for k in d])
if isinstance(params, list):
return [proc(d) for d in params]
diff --git a/test/engine/execute.py b/test/engine/execute.py
index 916c28e69..480158580 100644
--- a/test/engine/execute.py
+++ b/test/engine/execute.py
@@ -34,7 +34,7 @@ class ExecuteTest(testbase.PersistTest):
assert res.fetchall() == [(1, "jack"), (2, "fred"), (3, "ed"), (4, "horse"), (5, "barney"), (6, "donkey"), (7, 'sally')]
conn.execute("delete from users")
- @testbase.supported('mysql')
+ @testbase.supported('mysql', 'postgres')
def test_raw_sprintf(self):
for conn in (testbase.db, testbase.db.connect()):
conn.execute("insert into users (user_id, user_name) values (%s, %s)", [1,"jack"])