I have some code that returns what I'm calling a table object. return getattr(self.dbc, tablename)
where self.dbc is an SqlSoup object and tablename is the name of the table. Here's where it gets weird. I can create table objects for all of my tables from the python interpreter, however I get an exception when running my code in its normal environment on one particular table. When I try to get the table object for my table named 'entity', I get the below exception: File "lib\database\mysql.py", line 40, in getTableObject return getattr(self.dbc, tablename) File "c:\Python24\lib\site-packages\sqlalchemy-0.3.9dev_r2883- py2.4.egg\sqlalchemy\ext\sqlsoup.py", line 538, in __getattr__ t = class_for_table(table) File c:\Python24\lib\site-packages\sqlalchemy-0.3.9dev_r2883- py2.4.egg\sqlalchemy\ext\sqlsoup.py", line 444, in class_for_table klass = TableClassType(mapname, (object,), {}) TypeError: type() argument 1 must be string, not unicode For some reason, the line "mapname = 'Mapped' + _selectable_name(selectable)" in sqlsoup.py creates a unicode object instead of a string object when 'entity' is passed in. If I put a simple str() around the code ("mapname = str('Mapped' + _selectable_name(selectable))"), it works with no problem. Any reason why only this one particular case would cause this problem? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---