do you have a test case for this ?  the proxy_engine unit tests all pass
(i.e. lets add this failure case as well).

Im not sure how "object.getattr(self, "__dict__")" changes anything vs.
self.__dict__ (since the __getattr__ should only be called for
non-existent attributes), or how this error is occuring since it seems to
only be looking up "_engine" which was set in the constructor.

dmiller wrote:
> I got this error after updating sqlalchemy today:
>
>    File "/Users/dmiller/Code/PyOE/src/orderentry/model.py", line 394,
> in ?
>      assign_mapper(Value, value, properties=dict(alias=sa.relation
> (Alias)))
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/mapping/
> __init__.py", line 114, in assign_mapper
>      m = mapper(class_, *args, **params)
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/mapping/
> __init__.py", line 49, in mapper
>      return Mapper(class_, table, *args, **params)
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/mapping/
> mapper.py", line 175, in __init__
>      prop.init(key, self)
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/mapping/
> mapper.py", line 770, in init
>      self.do_init(key, parent)
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/mapping/
> properties.py", line 175, in do_init
>      self.primaryjoin = sql.join(parent.table, self.target).onclause
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/sql.py", line
> 41, in join
>      return Join(left, right, onclause, **kwargs)
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/sql.py", line
> 834, in __init__
>      self.onclause = self._match_primaries(left, right)
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/sql.py", line
> 851, in _match_primaries
>      if fk.references(primary):
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/schema.py",
> line 369, in references
>      return table._get_col_by_original(self.column) is not None
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/sql.py", line
> 570, in _get_col_by_original
>      return self.original_columns.get(column.original, None)
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/sql.py", line
> 1070, in _orig_columns
>      return self._orig_cols
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/ext/proxy.py",
> line 122, in __getattr__
>      return getattr(self._get_impl(), key)
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/ext/proxy.py",
> line 114, in _get_impl
>      e = self.engine
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/ext/proxy.py",
> line 122, in __getattr__
>      return getattr(self._get_impl(), key)
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/ext/proxy.py",
> line 114, in _get_impl
>      e = self.engine
>
>    ... many more recursions ...
>
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/ext/proxy.py",
> line 122, in __getattr__
>      return getattr(self._get_impl(), key)
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/ext/proxy.py",
> line 114, in _get_impl
>      e = self.engine
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/ext/proxy.py",
> line 124, in <lambda>
>      engine = property(lambda self: self._engine.engine)
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/ext/proxy.py",
> line 82, in __getattr__
>      if self.get_engine() is not None:
>    File "/Users/dmiller/Code/SQLAlchemy/lib/sqlalchemy/ext/proxy.py",
> line 43, in get_engine
>      if self.storage.engine is None:
> RuntimeError: maximum recursion depth exceeded
>
>
> This fixed it, although not elegantly (too many lookups going on,
> which is expensive in Python):
>
> class ProxyTableImpl(sql.TableImpl):
>
>      ... other methods omitted ...
>
>      def __getattr__(self, key):
>          d = object.getattr(self, "__dict__")
>          if key in d:
>              return d[key]
>          return getattr(self._get_impl(), key)
>
>
> ~ Daniel
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> Sqlalchemy-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users
>



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to