Issue2688
Created on 2018-05-23.13:16:34 by jonathan.simmonds, last changed 2018-11-25.07:56:29 by jeff.allen.
File name |
Uploaded |
Description |
Edit |
Remove |
Reproducer.java
|
jonathan.simmonds,
2018-05-23.13:16:34
|
Bug reproducer |
|
|
msg12000 (view) |
Author: Jonathan Simmonds (jonathan.simmonds) |
Date: 2018-05-23.13:17:23 |
|
As of Jython 2.7.1, adding a list containing non-PyObjects to another will result in a "java.lang.ClassCastException: <java type> cannot be cast to org.python.core.PyObject". The attached reproducer illustrates the problem - it works in 2.7.0 but not in 2.7.1+, instead failing on the final line.
This appears to be the result of a simple refactor (https://github.com/jythontools/jython/commit/707188dfbc029efac40819f6d864cf63bbdd71f3) rather than an intentional change: PyList.add takes Objects and performs the java2py wrapping itself, so attempting to cast the list to PyObjects before this point is incorrect.
|
msg12002 (view) |
Author: Jeff Allen (jeff.allen) |
Date: 2018-05-26.09:07:59 |
|
Thanks for reporting this, and especially for pinpointing the change. Sometimes one forgets just how elastic Jython is.
In some ways this is an interesting counterpart to "when are two lists equal" #2639, where the twist is objects on the list that are equal in Python but not in Java (e.g. 1==True).
|
msg12003 (view) |
Author: Stefan Richthofer (stefan.richthofer) |
Date: 2018-05-27.14:31:08 |
|
Sorry guys for messing this up. I'm currently on vacation and have only mobile device with me. Will fix it as soon as I'm back...
|
msg12009 (view) |
Author: Stefan Richthofer (stefan.richthofer) |
Date: 2018-06-17.11:51:13 |
|
Should be fixed as of https://hg.python.org/jython/rev/4b156d3d0d8b.
|
|
Date |
User |
Action |
Args |
2018-11-25 07:56:29 | jeff.allen | set | status: pending -> closed |
2018-06-23 18:31:18 | stefan.richthofer | set | resolution: accepted -> fixed |
2018-06-17 11:51:13 | stefan.richthofer | set | status: open -> pending messages:
+ msg12009 |
2018-05-27 14:31:08 | stefan.richthofer | set | assignee: stefan.richthofer messages:
+ msg12003 |
2018-05-26 09:08:00 | jeff.allen | set | priority: normal nosy:
+ stefan.richthofer, jeff.allen resolution: accepted messages:
+ msg12002 |
2018-05-23 13:17:23 | jonathan.simmonds | set | messages:
+ msg12000 |
2018-05-23 13:16:34 | jonathan.simmonds | create | |
|