#jython IRC Log


IRC Log for 2017-04-19

Timestamps are in GMT/BST.

[4:44] * ohumbel (c1c890b3@gateway/web/freenode/ip. Quit (Ping timeout: 260 seconds)
[7:28] * gsnedders (~gsnedders@ Quit (Ping timeout: 260 seconds)
[7:29] * gsnedders (~gsnedders@ has joined #jython
[11:07] * Parisa (~parterda@ has joined #jython
[11:07] <Parisa> hello al;
[11:07] <Parisa> al
[11:07] <Parisa> i am new to Jython
[11:08] <Parisa> i was trying to load an external python module
[11:08] <Parisa> and i am getting this error
[11:08] <Parisa> java.lang.RuntimeException: Method code too large!
[11:08] <Parisa> at org.python.objectweb.asm.MethodWriter.a(Unknown Source)
[11:08] <Parisa> at org.python.objectweb.asm.ClassWriter.toByteArray(Unknown Source)
[11:08] <Parisa> at org.python.compiler.ClassFile.write(ClassFile.java:232)
[11:09] <Parisa> i am using jython 2.7
[11:09] <Parisa> i tried using 2.7.1 b3
[11:10] <Parisa> it would be great if some one can tell me is there any other way to load external module to avoid this error..
[11:10] <Parisa> thank you
[11:46] * Parisa (~parterda@ Quit (Ping timeout: 240 seconds)
[11:54] * stewori (~stefan@ip-95-223-198-21.hsi16.unitymediagroup.de) has joined #jython
[11:56] <stewori> Parisa, the problem you observe was recently solved (more or less), but the solution is not included in 2.7.1b3.
[11:57] <stewori> Best you can do is making your own build, it's actually not that hard; you will need jdk 7 or 8 installed and ant
[11:58] <stewori> (e.g. git clone https://github.com/jythontools/jython
[11:58] <stewori> cd jython
[11:58] <stewori> ant installer
[11:58] * Parisa (~parterda@ has joined #jython
[11:59] <stewori> That version of Jython will prompt you to provide CPython bytecode for the module in question
[12:00] <stewori> (Jython can use CPython 2.7 bytecode for oversized methods, but currently needs CPython installed to generate that bytecode initially)
[12:00] <stewori> However it will print the exact command for letting CPython create the required pyc-file
[12:02] <stewori> Also note that the CPython bytecode for the oversized method will be embedded in the resulting class file, so you won't need to distribute pyc-files.
[12:07] * xemdetia (xemdetia@nat/ibm/x-pymkavtaizgvcmaj) has joined #jython
[12:08] <stewori> for detailed discussion of the issue you observed, see http://bugs.jython.org/issue527524 (Cannot compile to use methods exceeding JVM size restrictions)
[12:12] <Parisa> hi stewori
[12:12] <Parisa> thanks a lot for your inputs
[12:12] <Parisa> i am using jython standalone jar
[12:12] <Parisa> embedded in my java code
[12:13] <stewori> I think the standalon jar is built as a sideffect of "ant installer", but if not you can explicitly build it via "ant jar-standalone"
[12:13] <Parisa> so with latest code will that issue is resolved completely?
[12:14] <stewori> you still need CPython 2.7 initially
[12:14] <Parisa> ok
[12:14] <stewori> i.e. for the first import.
[12:14] <Parisa> ok
[12:15] <Parisa> ok jython with latest code and pyc files for my module would solve
[12:15] <stewori> exactly
[12:15] <Parisa> but i was facing an issue with loading module with pyc file
[12:16] <Parisa> i followed steps explained in jython book here
[12:16] <Parisa> http://www.jython.org/jythonbook/en/1.0/ModulesPackages.html#sys-meta-path
[12:16] <stewori> What CPython version was the pyc file?
[12:16] <Parisa> 2.7
[12:18] <stewori> The new version automates the pycimport way. It only uses the pyc-bytecode for the oversized method/function, not for the whole module (unless the module basis itself is an oversized function)
[12:18] <stewori> And it yields a better error message, e.g. it tells you if the pyc-file had the wron bytecode version
[12:19] <Parisa> do i need to add import pycimport statement?
[12:19] <Parisa> before loading module?
[12:19] <stewori> With latest version: No
[12:19] <stewori> It automatically takes the pyc file if present
[12:19] <Parisa> do i need to provide pyc files for all or only oversized modules?
[12:20] <stewori> Regarding your old pyc-issue: Prior to December 2016, Jython was stuck on CPython 2.5 bytecode support
[12:21] <stewori> Latest version in trunk has 2.7 bytecode support
[12:21] <Parisa> oh thats great
[12:21] <stewori> You only need pyc file for the module containing oversized method
[12:21] <Parisa> thank you so much
[12:21] <Parisa> let me try to get the code and build the new jar
[12:22] <stewori> (sorry for not having a release of that, we're sort of stuck on some few release-blockers currently)
[12:23] <Parisa> no problem
[12:24] <Parisa> thanks once again..
[12:24] <Parisa> bye for now..
[12:24] <stewori> hope it works
[12:54] * Parisa (~parterda@ Quit (Remote host closed the connection)
[12:54] * Parisa (~parterda@ has joined #jython
[13:36] * Parisa (~parterda@ Quit (Ping timeout: 240 seconds)
[13:38] * girish946 (~gsjoshi@ has joined #jython
[13:40] * xemdetia (xemdetia@nat/ibm/x-pymkavtaizgvcmaj) Quit (Remote host closed the connection)
[13:44] * Parisa (~parterda@ has joined #jython
[14:16] * Parisa (~parterda@ Quit (Quit: Leaving)
[14:20] * xemdetia (xemdetia@nat/ibm/x-ybeeiahzzixfqbtm) has joined #jython
[14:28] * girish946 (~gsjoshi@ Quit (Quit: Leaving)
[14:29] * girish946 (~gsjoshi@ has joined #jython
[14:52] * stewori (~stefan@ip-95-223-198-21.hsi16.unitymediagroup.de) Quit (Quit: Leaving.)
[15:07] * girish946 (~gsjoshi@ Quit (Quit: Leaving)
[15:17] * stewori (~stefan@ip-95-223-198-21.hsi16.unitymediagroup.de) has joined #jython
[18:19] * stewori (~stefan@ip-95-223-198-21.hsi16.unitymediagroup.de) Quit (Quit: Leaving.)
[19:59] <topi`> which methods are "oversized"? where is the limit?
[20:06] <topi`> oh, 64K of JVM bytecode is the limit per method
[20:14] <topi`> I wonder if it would be "easy" to have concurrent.futures (from python3) on Jython
[20:14] <topi`> it'd be great to benefit from JVM threads by using a ThreadPoolExecutor() in a very pythonic way
[20:49] * gsnedders (~gsnedders@ Quit (Ping timeout: 245 seconds)
[20:54] * gsnedders (~gsnedders@ has joined #jython
[22:05] <topi`> ok, pip install futures just did that thing


These logs were automatically created by JythonLogBot on irc.freenode.net using a slightly modified version of the Java IRC LogBot.