#jython IRC Log (v0.9)

Index

IRC Log for 2012-04-26

Timestamps are in GMT/BST.

[1:04] * shashank1 (~shashank@ucb-np2-83.colorado.edu) has joined #jython
[1:16] * lopex (u4272@gateway/web/irccloud.com/x-wkebrbpzskpeytjn) Quit (Remote host closed the connection)
[1:25] * juneau001 (~juneau@50-103-3-12.dklb.il.frontiernet.net) has joined #jython
[1:36] * shashank1 (~shashank@ucb-np2-83.colorado.edu) Quit (Ping timeout: 252 seconds)
[1:38] * lheuer1 (~Adium@blfd-4db0e9df.pool.mediaWays.net) has joined #jython
[1:38] * lopex (u4272@gateway/web/irccloud.com/x-cfffhckmleuvxkdo) has joined #jython
[1:40] * lheuer (~Adium@unaffiliated/lheuer) Quit (Ping timeout: 260 seconds)
[2:20] * shashank1 (~shashank@184-96-142-208.hlrn.qwest.net) has joined #jython
[2:38] * juneau001_ (~juneau@50-103-3-12.dklb.il.frontiernet.net) has joined #jython
[2:38] * juneau001 (~juneau@50-103-3-12.dklb.il.frontiernet.net) Quit (Read error: Connection reset by peer)
[2:38] * juneau001_ is now known as juneau001
[3:32] * juneau001 (~juneau@50-103-3-12.dklb.il.frontiernet.net) Quit (Quit: juneau001)
[5:42] * fwierzbicki_ (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) has joined #jython
[5:42] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) Quit (Read error: Connection reset by peer)
[5:42] * fwierzbicki_ is now known as fwierzbicki
[5:54] * Oti (~ohumbel@adsl-84-227-55-145.adslplus.ch) Quit (Quit: Oti)
[5:57] * JStoker (jstoker@unaffiliated/jstoker) Quit (Ping timeout: 244 seconds)
[6:08] * JStoker (jstoker@unaffiliated/jstoker) has joined #jython
[6:36] * espeed (~espeed@63.246.231.57) has joined #jython
[6:37] <espeed> how do you tell Jython to use the jars in your .m2 repo?
[6:44] * fwierzbicki_ (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) has joined #jython
[6:44] * fwierzbicki (~frank@99-106-170-105.lightspeed.sntcca.sbcglobal.net) Quit (Read error: Connection reset by peer)
[6:44] * fwierzbicki_ is now known as fwierzbicki
[7:04] * seletz (~seletz@85.236.236.50) has joined #jython
[7:28] * shashank1 (~shashank@184-96-142-208.hlrn.qwest.net) Quit (Quit: Leaving.)
[7:53] <saper> espeed: CLASSPATH?
[8:08] * robbyoconnor (~wakawaka@cpe-68-174-55-169.hvc.res.rr.com) has joined #jython
[8:08] * robbyoconnor (~wakawaka@cpe-68-174-55-169.hvc.res.rr.com) Quit (Changing host)
[8:08] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[8:18] * yanne_ (~jth@backport.reaktor.fi) has joined #jython
[8:21] * clajo04_ (~clajo04_@pool-108-41-219-3.nycmny.fios.verizon.net) Quit (Ping timeout: 246 seconds)
[8:21] * yanne (~jth@backport.reaktor.fi) Quit (Ping timeout: 246 seconds)
[8:21] * njoyce (~njoyce@109.203.113.22) Quit (Ping timeout: 246 seconds)
[8:21] * njoyce (~njoyce@109.203.113.22) has joined #jython
[8:25] * clajo04_ (~clajo04_@pool-108-41-219-3.nycmny.fios.verizon.net) has joined #jython
[8:58] * seletz (~seletz@85.236.236.50) Quit (Ping timeout: 265 seconds)
[10:26] * seletz (~seletz@85.236.236.50) has joined #jython
[10:32] * seletz (~seletz@85.236.236.50) Quit (Quit: seletz)
[10:55] * espeed (~espeed@63.246.231.57) Quit (Ping timeout: 272 seconds)
[11:05] * juneau001 (~juneau@131.225.24.74) has joined #jython
[11:06] * espeed (~espeed@63.246.231.57) has joined #jython
[11:16] * espeed (~espeed@63.246.231.57) Quit (Ping timeout: 260 seconds)
[11:20] * espeed (~espeed@63.246.231.57) has joined #jython
[11:25] * seletz (~seletz@85.236.236.50) has joined #jython
[13:06] * wainersm (wainersm@nat/ibm/x-lzueysyiirydgufb) has joined #jython
[13:10] * espeed (~espeed@63.246.231.57) Quit (Ping timeout: 272 seconds)
[13:15] * espeed (~espeed@63.246.231.57) has joined #jython
[13:28] * r0bby (~wakawaka@guifications/user/r0bby) has joined #jython
[13:30] * r0bby_ (~wakawaka@guifications/user/r0bby) has joined #jython
[13:31] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 265 seconds)
[13:33] * r0bby (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 252 seconds)
[13:47] * qwebirc27721 (47b88823@gateway/web/freenode/ip.71.184.136.35) has joined #jython
[13:48] * qwebirc27721 (47b88823@gateway/web/freenode/ip.71.184.136.35) has left #jython
[13:51] * qwebirc88466 (47b88823@gateway/web/freenode/ip.71.184.136.35) has joined #jython
[14:02] * enebo (~enebo@75-168-81-196.mpls.qwest.net) has joined #jython
[14:49] <qwebirc88466> Hello. I've hit a snag running the .class files generated by jython, if someone has a moment.
[15:08] <sabi-> qwebirc88466: please ask...
[15:21] <qwebirc88466> Thanks. Background: I've built a medium-size application, with swt and some other libraries.
[15:22] <qwebirc88466> The scripts all run well, and I have successfully bundled the aplication in a standalone jar.
[15:22] <qwebirc88466> To distribute the application, I wanted to reduce the size of the jar.
[15:23] <qwebirc88466> So, I removed the .py files, included only the jython-generated .class files...
[15:23] <qwebirc88466> and trimmed the interpreter stuff from the jython jar.
[15:24] <qwebirc88466> This reduces the resulting jar from 12MB to about 8MB, so it seems heading in the right direction.
[15:24] <qwebirc88466> The application appears to run ok, until it gets to an regular expression match command.
[15:25] <qwebirc88466> I'm putting together a pastebin...
[15:29] <qwebirc88466> Here is a test case: http://pastebin.com/sgyzKqR2
[15:29] <qwebirc88466> The .py scripts runs fine with python and jython, but the .class file throws the null pointer exception.
[15:32] <qwebirc88466> I've just include the top of the java traceback, as that seems to capture most of the information.
[15:33] <qwebirc88466> But I can include the rest, if needed.
[15:34] <qwebirc88466> The problem seems to be with the '(' in the pattern. If I remove them, then the search/match works...
[15:34] <qwebirc88466> but then I don't get the group (which is what I need, of course).
[15:38] <saper> interesting
[15:43] <qwebirc88466> Well, that wasn't my first thought. :-)
[15:44] <saper> can you put the rest of the exception?
[15:46] <qwebirc88466> Here's the revised pastebin: http://pastebin.com/iu057Hhb
[15:48] <sabi-> qwebirc88466: so this works with the full jython distro?
[15:48] <sabi-> (for you, i mean...)
[15:49] <qwebirc88466> The command: java -cp ~/jython2.5.3b1/jython.jar:. retest2\$py is using the full jython distro.
[15:49] <qwebirc88466> Sorry I wasn't clear: I hit the problem, then backed up to the full jython.jar and see the same thing.
[15:49] <sabi-> ok, i see what you mean now, sorry. :)
[15:50] <qwebirc88466> No problem.
[15:50] <saper> but it obviously relates to the Lib directory
[15:52] <qwebirc88466> Perhaps, but I pulled the Tokenizer class from the sre_parse.py file and just running that can reproduce the problem.
[15:54] <saper> well I don't have my jython sources unpacked right now but I would go from PyObject.java:1440 up
[15:54] <sabi-> qwebirc88466: ok, i was able to reproduce it
[15:54] <qwebirc88466> Here's a paste of the Tokenizer test case: http://pastebin.com/eATxYSAF
[15:55] <qwebirc88466> I added a print, just to see char and self.next.
[15:56] <saper> can't find 2.3.5b1 in hg
[15:56] <saper> ...
[15:57] <saper> 2.5.3b1 sorry
[15:57] <sabi-> qwebirc88466: i think it has to do with the class not performing adequate initialization, somehow
[15:57] <sabi-> versus the typical jython entry point
[15:58] <sabi-> if i delete the .py file, i can still import the $py.class and it works
[15:58] <sabi-> maybe you can use that as a workaround for now?
[15:58] <sabi-> i'd suggest filing a bug
[15:59] <saper> http://hg.python.org/jython-fullhistory/file/91332231a448/src/org/python/core/PyObject.java#l1440
[15:59] <saper> that's interesting
[16:00] <sabi-> not to stop you from trying to fix it :)
[16:00] <saper> t2 comes null
[16:00] * sabi- is now known as sabi
[16:02] <saper> which means someting is wrong with __class__
[16:02] <saper> qwebirc88466: can you check your "self.next.__class__"?
[16:02] <saper> or type(self.next)?
[16:05] <qwebirc88466> saper: if I put a print type(self.next) in the match method of my token.py test, the print throws the null pointer exception.
[16:07] <qwebirc88466> sabi: I'm not sure what you mean by 'delete the .py file' and 'import the $py.class'
[16:07] * DeeTah_ (d33tah@kolos.math.uni.lodz.pl) has left #jython
[16:08] <saper> qwebirc88466: and self.next.__class__ ?
[16:09] <saper> for some reason, self.next is improperly initialized, what sabi said
[16:10] <sabi> qwebirc88466: what i mean is that $py.class is like .pyc in CPython.
[16:10] <saper> good question if PyObject.typeSetup gets called at all
[16:10] <qwebirc88466> saper: Attempting the print self.next.__class__ also throws the exception.
[16:11] <sabi> if you're just trying to stop distributing .py files, then you can simply 'import modulename' and it'll import from the $py.class file.
[16:11] <sabi> then you'd just use the standard jython entry point, instead of your class
[16:11] <sabi> (e.g. org.python.util.jython)
[16:12] <saper> qwebirc88466: what I would do - try to isolate the case to the minimal test case (few lines of python stuff and a bunch of .class files, maybe)
[16:13] <qwebirc88466> sabi: Ah, I see. I'll explore that a bit.
[16:13] * seletz (~seletz@85.236.236.50) Quit (Quit: seletz)
[16:18] <qwebirc88466> saper: Ok, I'll see if I can define it a bit better by stripping down the Tokenizer test.
[16:19] <saper> once you get it, try with a some older jython versions to check for regression
[16:20] <sabi> qwebirc88466: take a look at http://www.jython.org/jythonbook/en/1.0/DeploymentTargets.html#deploying-a-single-jar - Main.java is an example of how you could write a trivial java wrapper class that imports your module
[16:21] <sabi> i just tried that with your test case and it worked...
[16:21] <qwebirc88466> sabi: Hmm, ok. I'll look into that, too.
[16:24] <qwebirc88466> Thanks for your help, sabi and saper. I'll be back, if can learn anything from a minimal test case (and if I have further questions!).
[17:04] * shashank1 (~shashank@97-118-114-67.hlrn.qwest.net) has joined #jython
[17:06] * jbaker (~jimbaker@canonical/jimbaker) has joined #jython
[17:09] * jbaker (~jimbaker@canonical/jimbaker) Quit (Remote host closed the connection)
[17:40] * seletz (~seletz@85.236.236.50) has joined #jython
[17:45] * shashank1 (~shashank@97-118-114-67.hlrn.qwest.net) Quit (Ping timeout: 246 seconds)
[18:30] * seletz (~seletz@85.236.236.50) Quit (Quit: seletz)
[18:40] * Oti (~ohumbel@adsl-84-226-70-65.adslplus.ch) has joined #jython
[18:41] <fwierzbicki> pr3d4t0r: is the Java Thursday Sushi Run a go? Just planning my evening :)
[19:03] <pr3d4t0r> fwierzbicki: Next week.
[19:04] <pr3d4t0r> fwierzbicki: This crazy girl who likes to walk naked around my friends invited me for sushi-for-two-n-movie tonight.
[19:04] <pr3d4t0r> fwierzbicki: Next Thu we're on 100% sure.
[19:10] * juneau001 (~juneau@131.225.24.74) Quit (Quit: Take care...)
[19:10] <fwierzbicki> ha - I totally understand :)
[19:20] * r0bby_ is now known as robbyoconnor
[19:24] <qwebirc88466> saper: A minimal test case for the null pointer exception we discussed earlier today is: '.'[0].__class__
[19:24] <qwebirc88466> A script with that single line runs fine under python or jython.
[19:24] <qwebirc88466> But compiling that script and attempting to run the .class file generates the exception:
[19:25] <qwebirc88466> java -cp ~/jython2.5.1/jython.jar:. script\$py
[19:25] <agronholm> you can't do that
[19:25] <agronholm> jython cannot create java entrypoints
[19:26] <qwebirc88466> I've gone as far back as jython2.5.1 to replicate the problem, but stopped there.
[19:26] <agronholm> the class files created by jython are unusable directly from java
[19:29] <qwebirc88466> agronholm: http://pastebin.com/hdKHpnHD
[19:31] <agronholm> qwebirc88466: what's your point?
[19:44] <qwebirc88466> To provide a counter-example to "you can't do that".
[19:44] <agronholm> can't do what
[19:44] <agronholm> ah
[19:44] <agronholm> well I'm surprised
[19:45] <agronholm> truly
[19:45] <agronholm> but what exception were you seeing before then?
[19:53] <qwebirc88466> http://pastebin.com/7qhubQy4 demonstrates the problem. test1.py works as expected (prints the .), whereas test2.py throws the exception.
[19:54] <qwebirc88466> This is followup to a conversation earlier today.
[19:55] <agronholm> have you tried running with 2.5.2?
[20:02] <qwebirc88466> Yes. 2.5.1, 2.5.2, 2.5.3b1
[20:05] <qwebirc88466> Earler, sabi suggested a java wrapper to invoke my main module, which seems to work for these test cases.
[20:05] <qwebirc88466> I'll use that method, but wanted to pursue the original problem a bit.
[20:07] <agronholm> how are you planning to deploy your app if running it with "java" is the only option?
[20:08] * shashank1 (~shashank@ucb-np2-222.colorado.edu) has joined #jython
[20:11] <qwebirc88466> agronholm: I've bundled everything into a jar. What led me down this particular rabbit hole was the desire to remove the .py files and try to reduce the size of the jar.
[20:12] <agronholm> and how do you deploy your app?
[20:12] <agronholm> what kind of app is it anyway
[20:13] <agronholm> server or client side
[20:37] * wainersm (wainersm@nat/ibm/x-lzueysyiirydgufb) Quit (Quit: Ex-Chat)
[20:50] <sabi> agronholm: i guess the real bug is that running a $py.class file *somewhat* works
[20:51] <sabi> it should either fail or succeed :)
[20:51] <agronholm> yeah, I'm just trying to find a practical solution
[20:53] <sabi> well, if it didn't define a main method, it wouldn't be runnable :)
[20:53] <sabi> that might be the easiest thing to do
[20:54] <agronholm> what exactly?
[20:54] <sabi> if jython relies on it, just rename it or something...
[20:54] <agronholm> relies on what?
[20:55] <sabi> the presence of a main method
[20:55] <agronholm> you mean in the generated class...?
[20:55] <agronholm> there's certainly none in the python code
[20:55] <agronholm> nor should there have to be
[21:20] <sabi> yeah, in the generated class.
[21:22] <qwebirc88466> sabi: I tried the java wrapper method you pointed me to earlier. My application now seems to work fine, including the re calls. Thank you!
[21:28] <saper> qwebirc88466: splendid!
[21:41] <sabi> awesome.
[21:46] * plankton (~peretto@201-89-30-178.cscgo702.dsl.brasiltelecom.net.br) has joined #jython
[21:48] <plankton> :)
[22:07] * plankton (~peretto@201-89-30-178.cscgo702.dsl.brasiltelecom.net.br) Quit (Ping timeout: 256 seconds)
[22:21] <fwierzbicki> oops muscle memory made me issue "push" - I did eventually want to push all of that but....
[22:56] * enebo (~enebo@75-168-81-196.mpls.qwest.net) Quit (Quit: enebo)
[23:17] * enebo (~enebo@75-168-81-196.mpls.qwest.net) has joined #jython
[23:45] * jimbaker (~jbaker@canonical/jimbaker) Quit (Ping timeout: 265 seconds)
[23:50] * enebo (~enebo@75-168-81-196.mpls.qwest.net) Quit (Quit: enebo)

Index

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