unicode identifiers in sqlsoup
unicode table names / selectable names need to be string encoded before generating classes for mapping.
Comments (13)
-
Account Deleted -
reporter do you have a test case that triggers this behavior? one of the reasons this ticket has been quiet is that i can't replicate the behavior. i don't doubt that it happens, i just can't seem to trigger it in the way that's been reported off and on in the irc channel.
-
Account Deleted - attached unicodetestcase.py
Test case (with sql to gen database) to trigger behavior
-
Account Deleted I've attached a test case which in my machine (with a trunk install of sqlalchemy, pyodbc and sql server 2005) results in the described behavior. It also exposes another problem with metadata, I think. But I'm not so sure of that one, or how it should be solved inside sqlsoup
-
Account Deleted i encouter this problem. May the fix not match my use case. I'll attach to this bug the temporary workaround i'm using
-
Account Deleted I'm using postgresql as database.
-
repo owner - assigned issue to
-
Account Deleted - assigned issue to
-
Account Deleted - changed status to resolved
applied the second proposed fix (the one in the diff), with a minor change to make it affect all selectables, not just tables.
-
Account Deleted - changed status to open
- removed status
-
Account Deleted MY bad, i reopened the ticket, sorry.
For the bug, i confirm that it is fixed with the current trunk (rev 5211)
-
repo owner -
repo owner - removed milestone
Removing milestone: 0.5.0 (automated comment)
- Log in to comment
I've found this problem when I load all tables from the database with metadata.reflect To solve it I changed the line from sqlsoup.py 420 mapname = 'Mapped' + _selectable_name(selectable) to 420 mapname = unicode('Mapped' + _selectable_name(selectable)).encode() Converting to unicode and encoding it back to a string should assure that even if the selectable name is a string, nothing breaks.
Can someone check if it can be merged into trunk?