Is Jython a liability in my codebase?

Question

I've inherited a large Java/Scala codebase that uses Jython to interface with our equally large Python codebase. Things were going swimmingly until about three days ago when suddenly all of our builds started failing in the Jython stage with the message:

RuntimeException: java.lang.RuntimeException: Method code too large!

As it turns out, there is an internal limit of 65kb for the size of a method inside the JVM. The latest version of Python requests seems to be the culprit, which is an important dependency of our Python codebase. My guess is that the latest version has introduced a really large class somewhere.

The most obvious solution is to pin the requests library version to an earlier version. Should I pin all library versions of our Python code (as I would do in Java)? Is there any work around besides version pinning? Am I making too much of the risk?


Show source
| java   | python   | jvm   | python-requests   | jython   2016-11-19 22:11 1 Answers

Answers to Is Jython a liability in my codebase? ( 1 )

  1. 2016-11-20 10:11

    I just happened to start using the Requests library today and ran into this. Tracked it down to the Idna library and specifically the uts46data.py file with a data structure exceeding Java's 64 kb Class limit (man is this a stupid thing).

    Cloned the main repo and corrected it at https://github.com/METAVERO/idna Left note on the requests and indna githubs. You may review my changes and incorporate them to a fresh download of requests.

Leave a reply to - Is Jython a liability in my codebase?

◀ Go back