[reportlab-users] [Jython2.5.1] issue: Invalid method Code length 656615 + patch proposal

Peter peter at maubp.freeserve.co.uk
Wed Feb 10 19:48:04 EST 2010


Raphaël wrote:

>> So, in my patch, I just wrap some fonts initialization code into

>> the fill_encodings method I introduce. This does the trick and

>> is totally transparent for CPython usage, so please just apply it.

>> After that Reportlab seems to work on Jython.


Robin Becker wrote:

> This code isn't broken for our use, jython appears broken for

> a common case. If the individual arrays had required more

> than 65k then ...


We had to deal with some similar issues in Biopython, and I
was initially reluctant to make "ugly" changes purely for Jython.
However, have a look at http://bugs.jython.org/issue527524
where Jython work to avoid this 65k limit has unfortunately
been deferred. It seems like in the short/medium term getting
Python code to work on Jython can require some "ugly" hacks.

e.g. This commit to a module defining a lot of data structures:
http://github.com/biopython/biopython/commit/2b2910fa0fb0a57f8a9656092fbb4653ce048b28

Before, lots of dicts defined directly in the module, Jython dies:
http://github.com/biopython/biopython/blob/1e498c46bceb39f45e34264c4c0b50dbef5d29c1/Bio/SubsMat/MatrixInfo.py

After, lots of dicts defined in temp functions, Jython works:
http://github.com/biopython/biopython/blob/2b2910fa0fb0a57f8a9656092fbb4653ce048b28/Bio/SubsMat/MatrixInfo.py

Peter


More information about the reportlab-users mailing list