Message12000

Author jonathan.simmonds
Recipients jonathan.simmonds
Date 2018-05-23.13:17:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527081443.95.0.682650639539.issue2688@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-05-23 13:17:23jonathan.simmondssetmessageid: <1527081443.95.0.682650639539.issue2688@psf.upfronthosting.co.za>
2018-05-23 13:17:23jonathan.simmondssetrecipients: + jonathan.simmonds
2018-05-23 13:17:23jonathan.simmondslinkissue2688 messages
2018-05-23 13:17:23jonathan.simmondscreate