#jython IRC Log


IRC Log for 2013-10-02

Timestamps are in GMT/BST.

[0:11] * fluxdude (~fluxdude@unaffiliated/fluxdude) Quit (Quit: fluxdude)
[0:20] * lheuer1 (~Adium@f048097167.adsl.alicedsl.de) has joined #jython
[0:21] * sinistersnare (6c1c5d99@gateway/web/cgi-irc/kiwiirc.com/ip. Quit (Remote host closed the connection)
[0:21] * sinistersnare (6c1c5d99@gateway/web/cgi-irc/kiwiirc.com/ip. has joined #jython
[0:23] * lheuer (~Adium@unaffiliated/lheuer) Quit (Ping timeout: 248 seconds)
[0:38] <sinistersnare> i swear something is wrong in my PYTHONPATH but i have no idea!
[0:38] <sinistersnare> im trying to use a source folder in my eclipse workspace, and im just lost :L
[0:56] * ivan`_ is now known as ivan`
[1:51] * sinistersnare is now known as sinsnare|nomnom
[2:09] * sinsnare|nomnom is now known as sinistersnare
[2:58] * lheuer1 (~Adium@f048097167.adsl.alicedsl.de) Quit (Quit: Leaving.)
[4:28] <sinistersnare> jimbaker: im leaving to do a middle school counselor thingy, and i wont be back til friday night, hope singlejar works by then :D
[4:29] * sinistersnare (6c1c5d99@gateway/web/cgi-irc/kiwiirc.com/ip. has left #jython
[5:38] * Oti (~ohumbel@adsl-84-227-111-222.adslplus.ch) Quit (Quit: Oti)
[5:49] * lheuer (~Adium@f048097167.adsl.alicedsl.de) has joined #jython
[5:49] * lheuer (~Adium@f048097167.adsl.alicedsl.de) Quit (Changing host)
[5:49] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[6:24] * Arfrever (~Arfrever@apache/committer/Arfrever) Quit (Ping timeout: 240 seconds)
[6:57] * osc (~oscar@ has joined #jython
[7:12] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[7:44] * Arfrever (~Arfrever@apache/committer/Arfrever) has joined #jython
[9:38] * agronholm (~agronholm@dsl-espbrasgw1-54f9c9-139.dhcp.inet.fi) Quit (Ping timeout: 264 seconds)
[9:53] * lopex (uid4272@gateway/web/irccloud.com/x-escfrztwjoqmtdbm) Quit (Ping timeout: 248 seconds)
[9:59] * lheuer (~Adium@unaffiliated/lheuer) has left #jython
[10:19] <vext01> morning
[11:36] * lopex (uid4272@gateway/web/irccloud.com/x-hhqwnnozfrtihnow) has joined #jython
[11:47] <topi`> guys, do you have "javalib" in your jython/dist directory?
[11:47] <topi`> it seems I'm missing that dir, which might explain why my attempt at Clamped fails, even though I followed the README
[11:53] <topi`> jimbaker: I got "no module named clamped", any suggestions?
[11:53] <topi`> (jyenv)topi@trelab:~/clamped/testjava$ java UseClamped
[11:53] <topi`> Exception in thread "main" ImportError: No module named clamped
[12:03] * zz_whg is now known as whg
[12:12] <topi`> grr, Java 1.7 is required for the procyon decompiler
[12:13] <topi`> jimbaker: I'm guessing you're using Java 1.7, maybe that might explain why I'm seeing trouble (I have jre1.6 from OpenJDK)
[12:30] <vext01> topi`: how did you build?
[12:36] * whg is now known as zz_whg
[12:41] * osc (~oscar@ Quit (Ping timeout: 252 seconds)
[12:45] * cameron__ (~thereisno@27-33-1-87.tpgi.com.au) Quit (Ping timeout: 245 seconds)
[12:58] * cameron__ (~thereisno@27-33-1-87.tpgi.com.au) has joined #jython
[12:58] * zz_whg is now known as whg
[13:02] <topi`> vext01: according to the instructions in clamped's README
[13:02] <topi`> I followed it to the letter
[13:03] <topi`> now, repeated it on another debian host, which has jre1.7.0 as default, in /opt/
[13:03] <topi`> Exception in thread "main" ImportError: No module named clamped
[13:05] <vext01> try `ant all-jars` in the jython dir
[13:08] <topi`> did that.
[13:08] <topi`> but it's "clamped" which is missing, not the core jython libs
[13:09] <topi`> jimbaker: that I noticed from decompiling, is that your Clamped project is compiled slightly differently than mine, here's the diff:
[13:09] <topi`> final PyObject python = ProxyMaker.findPython((PyProxy)this, "call");
[13:09] <topi`> whereas in your example, it's final PyObject findPython = ProxyMaker... blabla
[13:09] <topi`> this does not affect functionality, but to me it tells that different tools were used when building
[13:17] * Scorp1us (4b915e69@gateway/web/freenode/ip. has joined #jython
[13:30] <topi`> I got over this issue by setting up JYTHONPATH to my $HOME/clamped
[13:30] <topi`> but now it cannot load clamp.ProxyMaker
[13:30] <topi`> from clamp import ClampProxyMaker
[13:30] <topi`> ImportError: No module named clamp
[13:31] <topi`> and for some reason, it doesn't seem to obey JYTHONPATH at all...
[13:34] <Scorp1us> is there anyway to use a Pyservlet and a non-Pyservlet together?
[13:34] <Scorp1us> ie. I want a servlet that supposrts 3.0
[13:51] <topi`> supports 3.0 what?
[13:52] <topi`> Scorp1us: I think PyServlet is considered somewhat obsolete.. you should be using Modjy
[13:52] <Scorp1us> servlet 3.0 api
[13:54] <Scorp1us> Modjy supports servlet 3.0 ?
[14:04] <topi`> hmm, servlet 3.0 has annotations
[14:04] <topi`> and jython does not (yet) support java annotations
[14:08] <Scorp1us> well i need server push
[14:08] <Scorp1us> my framework supports comet
[14:14] <topi`> I found the reason for my troubles. Did some print()ing of sys.path to see what's different.
[14:15] <topi`> It seems that if I normally invoke jython from command line, the sys.path *does* include $HOME/jyenv/Lib/site-packages
[14:16] <topi`> if I run a java class with ProxyMaker support, then the sys.path does *not* contain that, it has very few entries, e.g. the /home/topi/jython-ssl/dist/Lib/site-packages (which is where I compiled my jython-ssl from)
[14:16] <topi`> MORAL OF THE STORY: do not think that virtualenvs work! (otherwise than for just using plain jython interpreter)
[14:19] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 240 seconds)
[14:26] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) has joined #jython
[14:30] <topi`> YES! finally. BarClamp doing something! 42!
[14:34] <topi`> I wonder why JYTHONPATH gets completely ignored when invoking Jython code by using clamp?
[15:30] <vext01> here's a tricky one
[15:30] <vext01> i have a python class that needs to be accessible from java
[15:30] <vext01> so i did like in the docs and made an interface
[15:31] <vext01> the python code looks like this:
[15:31] <vext01> class CoreEngine(CoreEngineType):
[15:31] <vext01> where CoreEngineType is the java interface
[15:31] <vext01> CoreEngine needs to implement a custom __new__ (long story)
[15:32] <vext01> whose __new__ do i call to allocate self?
[15:32] <vext01> object or CoreEngineType's?
[15:32] <vext01> most things i have tried end up with strange errors like:
[15:32] <vext01> e = CoreEngine("person(bob, 24).")
[15:32] <vext01> TypeError: org.python.proxies.jythog.engine$CoreEngine$1(): expected 0 args; got 1
[15:56] <jimbaker> topi`, yeah, i'm going to look at virtualenv at some point soon
[15:56] <jimbaker> but i'm glad you were able to make it work
[15:57] <jimbaker> and get that ultimate answer :)
[15:57] <jimbaker> vext01, i suggest you look at clamp as well :)
[15:58] <jimbaker> here's the starter project: https://github.com/jimbaker/clamped
[15:59] <jimbaker> hopefully singlejar and location in pypi will be done this week. i will also check its compatibility w/ virtualenv
[15:59] <jimbaker> which is really a question iirc of following symlinks properly
[16:08] <vext01> jimbaker: thanks
[16:09] * osc (~oscar@80-62-162-242-static.dk.customer.tdc.net) has joined #jython
[16:26] <topi`> jimbaker: yeah. I'm impressed by the brevity of code when using clamp :) As opposed to the PlyJy factory method.
[16:27] <jimbaker> topi`, it's fine i wrote both :)
[16:27] <topi`> hehe
[16:28] <topi`> jimbaker: is anyone working on getting annotation support into clamp?
[16:28] <topi`> because that'd be the jackpot then, the ultimate in java interoperability :)
[16:28] <topi`> could use all sorts of things like hibernate, then
[16:28] <topi`> jimbaker: did you read this post? http://fiber-space.de/wordpress/2009/06/30/stitches-of-a-flea-language-defining-java-annotations-in-jython/
[16:29] <topi`> it's an old one, but touches the essence of this
[16:41] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) Quit (Quit: enebo)
[16:48] <jimbaker> topi`, i plan to add support for annotations
[16:48] <jimbaker> possibly through some magic support for java annotations -> python function/class decorators
[16:49] <topi`> jimbaker: that'd be some fair magic, definitely
[16:49] <topi`> Gandalf-class stuff
[16:49] <jimbaker> similar to the comment pjenvey mentioned in that posing
[16:49] <jimbaker> topi`, nahh, just the usual bytecode rewriting typically seen w/ some annotations
[16:49] <topi`> python decorators themselves aren't very magical, though. Just function application ;)
[16:50] <jimbaker> annotations can just be that. but ASM is a good tool for reasonable magic
[16:51] <topi`> jimbaker: about those Tomcat container Permgen memory leaks... I'm seeing a leak at around 16 MB every time I stop/undeploy my Django project. I wonder where such a big amount of PermGen is going (it's only for class metadata)
[16:52] <jimbaker> topi`, hmmm, the usual thing to do would be to start looking at jconsole, then dig deeper
[16:52] <jimbaker> but you mentioned that weakref reaper thread not being stopped
[16:52] <topi`> jimbaker: I'll put clamp into some production use, when I finally get the Quartz scheduler working the way I want it.
[16:52] <topi`> running under Tomcat
[16:52] <jimbaker> sounds good
[16:53] <jimbaker> got to run, biab
[16:53] <topi`> jimbaker: I think the "weakref reaper" was only one of those messages in catalina.log
[17:00] * enebo (~enebo@75-146-46-229-Minnesota.hfc.comcastbusiness.net) has joined #jython
[17:01] * purplefox_ (~purplefox@host-80-43-252-143.as13285.net) has joined #jython
[17:05] <vext01> jimbaker: so i can't do what I am trying without clamp?
[17:06] <topi`> vext01: I think you can, but it might get a bit involved. Did you look at the clamped example?
[17:07] <topi`> vext01: I think __new__ is not used from the python side at all, since that is in __init__ ... I don't know if Clamp would utilize __new__ at all.
[17:31] <jimbaker> vext01, you can certainly use the older approach. but clamp is so much easier for this type of work
[17:33] <jimbaker> vext01, and it does offer significantly deeper java integration. next up is to start my other vapor ware project for pypi, expose
[17:33] <jimbaker> which is to provide the same expose mechanism we use for jython internally, to take java classes and bake them (w/ ASM rewriting of course!) as python types
[17:52] <vext01> i'm a bit overwhelmed by all of this
[17:52] <vext01> at this stage I understand the object factory approach and it is documented
[17:54] * enebo (~enebo@75-146-46-229-Minnesota.hfc.comcastbusiness.net) Quit (Quit: enebo)
[18:07] <jimbaker> vext01, then use that :)
[18:11] <vext01> well yes, indeed
[18:11] <vext01> however, it seems to interact with __new__ badly
[18:13] <vext01> https://bitbucket.org/vext01/jythog/src/4b7a62d290cdce9e831e8d871ae9e6f0efded4ba/lib-python/jythog/engine.py?at=master#cl-34
[18:14] <vext01> as soon as I inherit from the interface (which is empty for now), I get an error, as shown above
[18:14] <vext01> 16:31 < vext01> TypeError: org.python.proxies.jythog.engine$CoreEngine$1(): expected 0 args; got 1
[18:14] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) has joined #jython
[18:46] <jimbaker> vext01, yeah, i'm not certain how well we handle __new__. it doesn't really match java constructor semantics
[18:46] <jimbaker> but the easiest way to debug would be to decompile org.python.proxies.jythog.engine$CoreEngine$1
[18:47] <jimbaker> i recommend procyon as a decompiler
[18:49] <jimbaker> to capture the bytecode, you can use org.python.core.Options.proxyDebugDirectory
[18:53] <jimbaker> vext01, i guess one way to handle __new__ is to rework the proxy as a java factory. that would match java semantics, but we still need to return the right type of object
[18:54] <jimbaker> it's a very interesting question, a cool corner case, and right now, no answers :)
[19:01] * Scorp1us (4b915e69@gateway/web/freenode/ip. Quit (Ping timeout: 250 seconds)
[19:55] <vext01> hrm
[19:59] <jimbaker> vext01, so if can rewrite to avoid __new__, that's my advice for now
[20:06] <vext01> ye
[20:06] <vext01> thats what im thinking ;)
[20:10] <vext01> jimbaker: also, ive tried to create an account twice on the bugtracker, is it broken?
[20:15] <topi`> vext01: I got clamp working, at least that is an encouraging sign :)
[20:15] <topi`> I'll try to write a servlet in java, which would then use some functions written in python
[20:18] <vext01> nice
[20:21] * cameron__ (~thereisno@27-33-1-87.tpgi.com.au) Quit (Ping timeout: 240 seconds)
[20:34] * cameron__ (~thereisno@27-33-1-87.tpgi.com.au) has joined #jython
[20:35] <topi`> what bugs me is the memory leak I get in django when deployed on Tomcat
[20:35] <topi`> every redeploy eats 16MB of permgen
[20:36] <topi`> I need to learn to use some jvm tooling
[20:37] <jimbaker> vext01, periodically the bugtracker is broken... we use the same as cpython however
[20:37] <jimbaker> just with different branding
[20:38] * Oti (~ohumbel@adsl-89-217-122-223.adslplus.ch) has joined #jython
[20:40] <jimbaker> Oti, good to see you!
[20:40] <Oti> jimbaker, hello again!
[20:40] <jimbaker> topi`, i think we need to extract a test case of your tomcat problem
[20:41] <Oti> it's true I've been hiding...
[20:42] <jimbaker> Oti, no worries, hiding is a good strategy :)
[20:42] <jimbaker> there's enough to do, always
[20:42] <Oti> i can imagine??? whats hot nowadays?
[20:43] <jimbaker> but i'm seriously thinking of visiting switzerland next summer, in conjunction with a visit to the rackspace zurich office
[20:43] <Oti> oh cool - please let me know in advance!
[20:43] <jimbaker> what's hot? i think better java integration is the key piece i have been working on, in both directions
[20:44] <topi`> jimbaker: that'll be difficult, since i'm using django and who knows how many classes it instantiates ..
[20:44] <topi`> jimbaker: I can only imagine the dependency soup, when django's ORM starts loading the relevant SQL classes, SQL adapters and so on...
[20:44] <jimbaker> Oti, so good progress on clamp, and i have been thinking about expose - allowing third-party libraries to use java classes as python types through the same internal expose mechanism jython uses
[20:45] <jimbaker> topi`, yeah... but none of that really should matter
[20:45] <topi`> jimbaker: do you have any cool jobs at rackspace? I didn't know there are european offices
[20:45] <jimbaker> the key piece is that something is holding onto classes
[20:45] <jimbaker> topi`, we have offices in london and zurich in europe
[20:45] <topi`> cool
[20:45] <jimbaker> and we do hire people who know twisted + python
[20:45] <topi`> ok good :)
[20:45] <jimbaker> among many other skills
[20:46] * shashank (~shashank@ Quit (Quit: Leaving.)
[20:46] <jimbaker> there's a fair # of remote people
[20:46] <jimbaker> like myself
[20:46] <topi`> I've also been involved w/ NoSQL deployments
[20:46] * shashank (~shashank@ has joined #jython
[20:46] <topi`> so you work from your home, in Colorado, and there are no Colorado offices?
[20:46] <jimbaker> yep, we do that too. my team does a lot of work w/ cassandra
[20:46] <jimbaker> topi`, correct about colorado
[20:47] <topi`> jimbaker: do you have "virtual meetings" or just commit your stuff to git and receive an email about the next sprint? :)
[20:47] <jimbaker> topi`, so the most usual suspect is some thread is holding onto a classloader, which is holding onto classes
[20:47] <topi`> jimbaker: I live in the West Coast Finland, about 200 km away from the offices of my company. I'm mostly just communicating via Skype (so the NSA knows)
[20:48] <topi`> and twice a month I go to the offices for 2 days
[20:48] <jimbaker> topi`, all sorts of way to coordinate - occasional in person meetings, daily standups, and lots of github
[20:48] <topi`> jimbaker: yup. I need to see how and why Django creates threads. Or maybe these are created by another component. like, say, java.net.URL
[20:48] <jimbaker> topi`, well the reaping thread is definitely a suspect
[20:49] <topi`> what's the meaning of that thread? (and who starts it?)
[20:49] <jimbaker> we do, to clean things up
[20:49] <jimbaker> i don't think it would necessarily touch user classes
[20:49] <jimbaker> but it should be shutdown regardless
[20:50] <topi`> is there a debug flag to see if it shutdowns?
[20:50] <jimbaker> only by looking at jmx
[20:50] <jimbaker> jconsole is a good frontend of that
[20:50] <jimbaker> it's very simple to use
[20:51] <jimbaker> especially if on the same machine
[20:51] <topi`> ok, I need to set up jconsole
[20:51] <topi`> I tried on the corporate tomcat, but failed b/c of lack of permissions
[20:51] * lheuer (~Adium@ has joined #jython
[20:51] * lheuer (~Adium@ Quit (Changing host)
[20:51] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[20:51] <topi`> will try to get them to set up jmx
[20:53] <Oti> topi', i'd recommend jvisualvm, it has a console and a visualgc plugin (easy to download and install from inside)
[20:53] <Oti> so you have best of both worlds
[20:53] <Oti> console plugin i meant
[20:54] <Oti> [grr my client is replacing j-console with console]
[20:56] <topi`> Oti: I'm using django 1.5 on jython 2.7, do you know of such installations?
[20:56] <topi`> so far so good, but the memory leaks bug me, especially since I redeploy so often
[20:56] <topi`> and don't have the permissions to re-start tomcat on the deployment server
[20:57] <Oti> topi`, no i haven't used django with jython so far
[21:00] <Oti> jimbaker, to get a feeling again, I thought I start with builds/build bots
[21:00] <Oti> what do we have regarding continuous integration?
[21:02] <Oti> we have an orphaned jenkins on fedora lying around, the first step would be to reanimate it and make it public
[21:02] * agronholm (~agronholm@2001:1bc8:102:6f29:28a1:5f47:4681:3985) has joined #jython
[21:02] * ChanServ sets mode +o agronholm
[21:03] * agronholm (~agronholm@2001:1bc8:102:6f29:28a1:5f47:4681:3985) Quit (Client Quit)
[21:04] * agronholm (~agronholm@2001:1bc8:102:6f29:28a1:5f47:4681:3985) has joined #jython
[21:04] * ChanServ sets mode +o agronholm
[21:08] <jimbaker> Oti, i would love to have jenkins in place. there is a buildbot too that sven setup - http://supersven.net:8010/
[21:09] <jimbaker> Oti, the huge advantage of jenkins is that i can see the failed tests go down (which is one reason i actually don't like skips, except when necessary)\
[21:10] <jimbaker> it hasn't been so important for this stage in 2.7 because we are working on bigger issues, but at some point we need to address all the little things
[21:13] <topi`> interesting messages in tomcat's log.
[21:13] <topi`> SEVERE: The web application [/mysite] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@16c1e591]) and a value of type [org.python.core.PyDictionary] (value [{'value': u'/mysite/'}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
[21:14] <jimbaker> and of course not see regressions. so jenkins is very strong on breaking out indiv tests
[21:14] <topi`> so, there is a PyDictionary with the root URL of the site, but why is this a ThreadLocal?
[21:14] <jimbaker> topi`, oh that's very interesting
[21:14] <Oti> jimbaker: it is my coworker's home machine, which he let's us share. Is there e problem if it doesn't start a build on every push, but only ~2 times a day?
[21:14] <jimbaker> Oti, that works for me
[21:14] <topi`> jimbaker: I also see similar messages, but with empty dicts {}
[21:15] <jimbaker> topi`, so i don't know this ThreadLocal, but in general they are very useful - and super prone to causing memory leaks
[21:15] <jimbaker> it's good that tomcat is applying this coping strategy however
[21:16] <jimbaker> previous versions did not
[21:17] <topi`> I also see value [org.python.core.ThreadState@6878228] there
[21:18] <topi`> jimbaker: so, this means that the thread that has this ThreadLocal is still lingering somewhere and GC cannot touch its class references?
[21:18] <topi`> possibly the thread has also a PySystemState?
[21:19] <jimbaker> as long as the thread is around with that threadlocal, which ties to a threadstate, which ties to a pysystemstate...
[21:19] <topi`> it's a gordion's knot
[21:20] <jimbaker> so essentially in java, threads are the ultimate root for a reachability graph
[21:20] <jimbaker> topi`, we have hacked away at this knot a bit
[21:20] <jimbaker> but i don't think we have solved all issues, that's correct
[21:21] <jimbaker> having a ref to a PySystemState is not inherently bad btw
[21:21] <jimbaker> that is effectively the jython runtime
[21:23] * osc (~oscar@80-62-162-242-static.dk.customer.tdc.net) Quit (Ping timeout: 264 seconds)
[21:24] <topi`> jimbaker: one question, why does the clamped example BarClamp class inherit from Callable and Serializable?
[21:25] <jimbaker> topi`, because it's just an example :)
[21:25] <topi`> so I could inherit even from Runnable and then call its run() method from java?
[21:25] <jimbaker> Callable - to have something simple that can be called from java
[21:25] <jimbaker> so Runnable would be fine too, but it wouldn't return a value, just have a side effect
[21:25] <topi`> I really need to buy a good Java book, maybe the one from Bruce Eckel?
[21:26] <jimbaker> Serializable is a more interesting choice. it's necessary for some integrations like storm. not for others
[21:26] <jimbaker> bruce's book is really good, but i think it only covers to java 5
[21:26] <topi`> then it's good for starting ;)
[21:27] <topi`> will still treat all the collections, generics, etc
[21:27] <jimbaker> yes, most of the new stuff in java 6 and java 7 is significantly more sophistication in libraries
[21:28] <jimbaker> java 8 does change things, but that doesn't come out until next year anyway
[21:29] <topi`> damn, cannot really afford that book
[21:31] <jimbaker> topi`, there are certainly other good resources
[21:39] <Oti> topi`, maybe http://docs.oracle.com/javase/tutorial/ as a start
[22:19] * Arfrever (~Arfrever@apache/committer/Arfrever) Quit (Ping timeout: 246 seconds)
[22:46] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) Quit (Quit: enebo)
[23:11] * rgb247 (~rgb24@ has joined #jython
[23:11] <rgb247> anyone there who can help me with an answer?


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