[Sqlalchemy-tickets] [sqlalchemy] #2794: CircularDependencyError with jython because WeakSequence d
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-08-02 10:18:48
|
#2794: CircularDependencyError with jython because WeakSequence doesn't preserve
order
--------------------+-----------------------------------------
Reporter: sayap | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: utils | Severity: no triage selected yet
Keywords: | Progress State: awaiting triage
--------------------+-----------------------------------------
I am toying with Jython, and the same app that works fine with CPython
somehow throws a `CircularDependencyError` when trying to insert an
instance of a mapped class that participates in a joined table
inheritance.
I trace down the culprit to be `WeakSequence.__iter__()`, which doesn't
preserve the insertion order.
Changing the line from:
{{{
# 0.8
return self._storage.itervalues()
}}}
or:
{{{
# 0.9
return iter(self._storage.values())
}}}
to:
{{{
for idx in sorted(self._storage):
yield self._storage[idx]
}}}
make things work again on Jython.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2794>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|