Issue1878
Created on 2012-04-27.12:37:32 by espeed, last changed 2014-05-21.22:17:20 by zyasoft.
msg7067 (view) |
Author: James Thornton (espeed) |
Date: 2012-04-27.12:37:32 |
|
Jython 2.5.2 is throwing this TypeError when met with a Java Map that is already itarable:
temp_id = Peer.tempid("db.part/user")
TypeError: Supertypes that share a modified attribute have an MRO conflict[attribute=__iter__, types=[<type 'java.lang.Iterable'>, <type 'java.util.Map'>]]
Here's the Jython source that contains the error message:
https://gist.github.com/2506332
See https://groups.google.com/d/msg/datomic/b8iODxDmmvM/soOcdhcvFmgJ
|
msg7068 (view) |
Author: Frank Wierzbicki (fwierzbicki) |
Date: 2012-04-27.16:54:41 |
|
Thanks for the bug report James - your timing is good as we are closing in on a 2.5.3 and it would be very cool to see Datomic working with Jython.
|
msg7069 (view) |
Author: Frank Wierzbicki (fwierzbicki) |
Date: 2012-04-27.17:13:35 |
|
I'm sure I'm just reading the bug report wrong - I tried
import java.util.HashMap;
import java.util.Iterator;
public class IterableMap extends HashMap implements Iterable {
public Iterator iterator() {
return this.keySet().iterator();
}
}
But that doesn't trigger an MRO conflict - do you have a simple code snippet that triggers the problem?
|
msg7070 (view) |
Author: James Thornton (espeed) |
Date: 2012-04-27.20:50:17 |
|
Sure Frank -- here's a snippet that generates the error:
https://gist.github.com/2512943
Also notice the try/except hacks around Peer.tempid, conn.db, and Peer.q -- those are wrapped in a try/except block and then each method is immediately called again because it only generates an error the first time the method is called.
|
msg7071 (view) |
Author: Frank Wierzbicki (fwierzbicki) |
Date: 2012-04-28.04:35:37 |
|
Hi James - thanks for the snippet - but I'm not currently a user of Datomic - is it possible for you to come up with a code snippet that doesn't have external dependencies - that will greatly help me get to the bottom of the bug.
|
msg8035 (view) |
Author: Jim Baker (zyasoft) |
Date: 2013-05-31.04:36:28 |
|
Issue seen in another Clojure project, Storm. Should be readily resolvable by special casing in PyJavaType.
|
msg8041 (view) |
Author: Jim Baker (zyasoft) |
Date: 2013-06-11.17:14:35 |
|
Potential fix in this branch:
https://bitbucket.org/jimbaker/proxies
Still needs decent test cases that do not depend on Storm/Clojure.
|
msg8045 (view) |
Author: Jim Baker (zyasoft) |
Date: 2013-06-14.19:56:16 |
|
Fixed as of 7110:8d2f8c3a2299
|
|
Date |
User |
Action |
Args |
2014-05-21 22:17:20 | zyasoft | set | status: open -> closed |
2013-06-14 19:56:16 | zyasoft | set | resolution: accepted -> fixed messages:
+ msg8045 |
2013-06-11 17:14:35 | zyasoft | set | messages:
+ msg8041 |
2013-05-31 04:36:29 | zyasoft | set | messages:
+ msg8035 |
2013-05-31 04:33:38 | zyasoft | set | assignee: zyasoft resolution: accepted nosy:
+ zyasoft |
2013-02-25 21:56:33 | fwierzbicki | set | priority: normal versions:
+ Jython 2.5, - 2.5.2 |
2012-04-28 04:35:37 | fwierzbicki | set | priority: high -> (no value) assignee: fwierzbicki -> (no value) messages:
+ msg7071 |
2012-04-27 20:50:17 | espeed | set | messages:
+ msg7070 |
2012-04-27 17:13:35 | fwierzbicki | set | messages:
+ msg7069 |
2012-04-27 16:54:41 | fwierzbicki | set | priority: high assignee: fwierzbicki messages:
+ msg7068 nosy:
+ fwierzbicki |
2012-04-27 12:37:32 | espeed | create | |
|