RuntimeError: maximum recursion depth exceeded -- When a column is named 'state'.
I think I've found a bug when a column is named 'state'. I'm getting 'RuntimeError: maximum recursion depth exceeded' exception. At first I thought it had something to do with the underscores I am using as the first character of all my column names, but it just seems to be the word 'state' itself. I've attached a file that demonstrates this unusual situation. This was found in version 0.4.5.
This is the actual exception traceback:
File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.4.5-py2.5.egg/sqlalchemy/orm/attributes.py", line 44, in __get__
return self.impl.get(instance._state)
Comments (4)
-
Account Deleted -
repo owner - changed milestone to 0.4.xx
- changed watchers to carl.nobile@gmail.com
this bug is not surprising. assuming we are merging the user_defined_state branch soon, I'd recommend we have the fix over there since the methodology for getting at "_state" is changing. ultimately though the fix will probably have to be of the "name change" variety, meaning you still could get in trouble if you named a column "_sa_state", which is what we'd probably call it.
as a workaround for now you should redefine the name at the ORM level using the properties dictionary, or set a "key" attribute on the actual
Column
which changes the name to something non-conflicting. -
These types of conflicts are now detected and blocked at mapper() definition in d58ee9492d5f5221339cee50ab27ac5c4762e6fd.
-
repo owner - removed milestone
Removing milestone: 0.5.0 (automated comment)
- Log in to comment
My email is: carl.nobile@gmail.com I'd be more that happy to correspond about the bug I posted. -Carl