Closed
Description
Migrated issue, originally created by Anonymous
TypeError: execute() parameters must be strings
- reflecting tables from postgresql so column names are unicode strings
- using polymorphic loading
- convert_unicode=(True|False) had no effect
this patch fixes it for me but other places where reflected strings are used as kwarg keys will cause the same problem
--- mapper.py (revision 3314)
+++ mapper.py (working copy)
@@ -1560,7 +1560,7 @@
params = {}
for c in param_names:
- params[c.name](c.name) = self.get_attr_by_column(instance, c)
+ params[str(c.name)](str(c.name)) = self.get_attr_by_column(instance, c)
row = selectcontext.session.connection(self).execute(statement, **params).fetchone()
self.populate_instance(selectcontext, instance, row, isnew=False, instancekey=identitykey, ispostselect=True)
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
sqlalchemy-bot commentedon Aug 15, 2007
Michael Bayer (@zzzeek) wrote:
we support unicode bind param keys, so the issue here lies elsewhere. small test cases are very helpful here since ill have to write one myself in order to locate.
sqlalchemy-bot commentedon Aug 15, 2007
Michael Bayer (@zzzeek) wrote:
fixed in 2708a34
sqlalchemy-bot commentedon Aug 15, 2007
Changes by Michael Bayer (@zzzeek):