#jython IRC Log (v0.9)

Index

IRC Log for 2013-10-14

Timestamps are in GMT/BST.

[0:11] * verterok (~ggonzalez@91.189.93.33) has joined #jython
[0:35] * lheuer1 (~Adium@f048032066.adsl.alicedsl.de) has joined #jython
[0:37] * lheuer (~Adium@unaffiliated/lheuer) Quit (Ping timeout: 240 seconds)
[1:54] * sinsnare|away is now known as sinistersnare
[2:21] * lheuer1 (~Adium@f048032066.adsl.alicedsl.de) Quit (Quit: Leaving.)
[3:19] * dso__ (~dso@99-16-65-103.lightspeed.sprntx.sbcglobal.net) has joined #jython
[3:47] * sinistersnare is now known as sinsnare|zzZZzz
[4:13] * fluxdude (~fluxdude@unaffiliated/fluxdude) Quit (Quit: fluxdude)
[5:05] * dso__ (~dso@99-16-65-103.lightspeed.sprntx.sbcglobal.net) Quit (Ping timeout: 272 seconds)
[5:23] * lheuer (~Adium@f048032066.adsl.alicedsl.de) has joined #jython
[5:23] * lheuer (~Adium@f048032066.adsl.alicedsl.de) Quit (Changing host)
[5:23] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[5:47] <jimbaker> if you want to check out singlejar support, it has landed here: https://github.com/jythontools/clamp
[5:47] <jimbaker> docs need to be written. my clamped project needs to be updated.
[5:47] <jimbaker> we will get to that, this week!
[5:48] <jimbaker> one thing that needs to be looked at is how to migrate manage.py's support for war files to using singlejar
[5:52] <jimbaker> one more thing - singlejar support has necessitated a deeper integration w/ site-packages. not too deep, but deep enough
[6:54] * Arfrever (~Arfrever@apache/committer/Arfrever) Quit (Quit: Ex??re)
[7:08] <topi`> jimbaker: "deeper integration" sounds like worse spaghetti, deep intersections between different projects of code, hence a unit testing hell :)
[7:21] * Arfrever (~Arfrever@apache/committer/Arfrever) has joined #jython
[7:39] * purplefox (~purplefox@host-80-43-252-143.as13285.net) has joined #jython
[8:16] <topi`> nah, I am just a pessimist :)
[8:17] <topi`> perhaps I need to update the Jython thread in Twisted tracker, to reflect the changes in jython trunk
[8:44] * jarekps (~jsmiejcza@office.clearcode.cc) has joined #jython
[8:54] * jarekps (~jsmiejcza@office.clearcode.cc) Quit (Read error: Operation timed out)
[8:56] * jarekps (~jsmiejcza@office.clearcode.cc) has joined #jython
[10:22] * wmeissner (~wmeissner@110.93.21.146) has joined #jython
[10:46] * lheuer (~Adium@unaffiliated/lheuer) Quit (Quit: Leaving.)
[10:47] * lheuer (~Adium@f048032066.adsl.alicedsl.de) has joined #jython
[10:47] * lheuer (~Adium@f048032066.adsl.alicedsl.de) Quit (Changing host)
[10:47] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[12:06] * wmeissner (~wmeissner@110.93.21.146) Quit (Quit: wmeissner)
[12:14] * wmeissner (~wmeissner@110.93.21.146) has joined #jython
[12:58] * wmeissner (~wmeissner@110.93.21.146) Quit (Quit: wmeissner)
[13:10] * lheuer1 (~Adium@f048032066.adsl.alicedsl.de) has joined #jython
[13:13] * lheuer (~Adium@unaffiliated/lheuer) Quit (Read error: Connection reset by peer)
[13:34] * verterok (~ggonzalez@91.189.93.33) Quit (Changing host)
[13:34] * verterok (~ggonzalez@unaffiliated/verterok) has joined #jython
[13:45] * zz_whg is now known as whg
[13:51] * fluxdude (~fluxdude@unaffiliated/fluxdude) has joined #jython
[14:23] <jimbaker> topi`, you're too skeptical ;) all i did was figure out a way to put jars in site-packages in a reasonable fashion that they could be accessible with a .pth file (so automatically on sys,path, and imported by jython's classloader) and available for repackaging under the singlejar idea
[14:24] <jimbaker> i really wanted to push them into the eggs themselves, but setuptools makes this really hard. too hard for me to figure out, at least in the time i had to do this
[15:32] * purplefox (~purplefox@host-80-43-252-143.as13285.net) Quit (Quit: Leaving)
[17:03] * fluxdude (~fluxdude@unaffiliated/fluxdude) Quit (Quit: fluxdude)
[17:05] * jarekps (~jsmiejcza@office.clearcode.cc) Quit (Quit: jarekps)
[17:10] <jimbaker> topi`, updated https://github.com/jimbaker/clamped to reflect what's new in the clamp package
[17:16] * lheuer1 is now known as lheuer
[17:16] * lheuer (~Adium@f048032066.adsl.alicedsl.de) Quit (Changing host)
[17:16] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[18:03] <topi`> jimbaker: I still haven't managed to find the root cause why a for loop which executes a ping command via subprocess.check_output() is exhausting all fd's
[18:04] <topi`> I checked the source for subprocess.py and it uses some simple forms of java libs to do the shell magic.
[18:04] <topi`> but it did close the file handle in all code paths.
[18:14] * dso__ (~dso@75-63-109-65.uvs.hstntx.sbcglobal.net) has joined #jython
[18:16] <jimbaker> topi`, do you have a test case in a paste somewhere?
[18:19] <topi`> I lost the shell since I had to reboot the damn OSX but I'll recreate it easily (just a for loop that goes sequentially thru a ping function)
[18:22] <jimbaker> topi`, you can also do this, w/ sufficient privileges - http://docs.oracle.com/javase/7/docs/api/java/net/InetAddress.html#isReachable(int)
[18:23] <topi`> I'm doing this loop:
[18:23] <topi`> >>> for i in range(1024):
[18:23] <topi`> ... lst.append( ping(a1) )
[18:23] <topi`> where a1 is an ip address and ping() calls /bin/ping -c2 {addr}
[18:23] <topi`> wait,
[18:26] <jimbaker> topi`, right. so presumably if just did subprocess w/ something innocuous, like sleep or ls, i would see the same thing
[18:28] <topi`> ...I had to soothe the child back to sleep
[18:29] <topi`> no, I'm not talking about processes, forking or such;)
[18:30] * r0bby_ (~wakawaka@guifications/user/r0bby) Quit (Read error: Connection reset by peer)
[18:31] <topi`> jimbaker: https://gist.github.com/tkanerva/6979907
[18:31] <jimbaker> topi`, sure, no forking, just using subprocess' support of ProcessBuilder
[18:32] <topi`> jimbaker: recently I found out that you can cut/copy rectangular sections in OSX terminal, it makes it possible to directly paste that into the interpreter.
[18:33] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[18:33] <topi`> jimbaker: I guess InetAddress would suffice, but then I need to upgrade openjdk 1.6 -> 1.7
[18:34] <topi`> Oh. Since: JDK 1.0
[18:34] <topi`> the nifty bit about Jython is that you can invoke these Java classes directly from interpreter
[18:39] <topi`> umm? TypeError: No visible constructors for class (java.net.Inet4Address)
[18:40] <topi`> I tried: >>> addr=Inet4Address("8.8.8.8")
[18:40] <topi`> ah, this must be because of there is no constructor for a single String arg.
[18:41] <jimbaker> topi`, is it possible that some of the pings are slow? i'm trying a subprocess loop and have ran it through 60,000 iterations at this point just doing "ls /"
[18:41] <topi`> OK, stackoverflow knows: "Why do the Inet*Address classes have no visible constructors?"
[18:41] <topi`> "because it's a factory class"
[18:42] <topi`> jimbaker: I couldn't reproduce the issue this time, either.
[18:42] <topi`> if I hadn't run out of battery, I could still check the exact environment...
[18:42] <topi`> I *know* that code gets me in trouble if I run it under Tomcat
[18:42] <jimbaker> topi`, i could definitely see slow pings causing problems. making a scalable ping is actually a nice challenge
[18:43] <topi`> jimbaker: but this isn't exactly async programming.. shouldn't the loop block until the ping returns?
[18:43] <topi`> and, hence, all variables and filedescs are reused.
[18:43] <jimbaker> twisted is good for that of course... but lack of direct icmp support in java makes this problematic
[18:45] <jimbaker> topi`, you're right in this case, we expect blocking
[18:46] <topi`> jimbaker: unless there is some kind of factory spewing out new instances of ProcessBuilder, that then keep refs to the file descriptors, I can't see why such a loop would exhaust fd's
[18:47] <jimbaker> anyway, i have run 100,000+ iterations of my subprocess loop: https://gist.github.com/jimbaker/6980135
[18:47] <jimbaker> topi`, i would expect it would have seen similar behavior of my simpler loop
[18:48] <topi`> I'm running that loop as well, I see no resource exhaustion
[18:49] <topi`> and, when I originally observed the lack of fd's, I did notice that I was able to re-run the same loop after a pause of 30 seconds (which is maybe related to the GC interval?)
[18:49] <jimbaker> if there is an expectation of deterministic refcounting closing resources, gc would fix that
[18:50] <jimbaker> but running a tight loop like above should have forced resource exhaustion in that case, since it would outpace the GC, by a lot :)
[18:50] <topi`> is this so even with a with: statement?
[18:50] <jimbaker> the with statement, using a context manager to close, will ensure deterministic close
[18:50] <topi`> what I observed when using zxJDBC in a with conn() as c: block is that I had a memory leak there
[18:50] <jimbaker> so either in the context manager, or using something like contextlib.closing
[18:51] <topi`> actually - more like Postgresql complaining that the MAX_CONNECTIONS has been reached
[18:51] <jimbaker> topi`, yeah, it's up to the connection manager
[18:51] <jimbaker> topi`, does jyjdbc work w/ django?
[18:51] <jimbaker> i would trust that codebase much more
[18:51] <topi`> jimbaker: I'll try that one. but I thought that zxjdbc would be "tried and tested" since it's evidently of older origin
[18:52] <jimbaker> maybe we should simply pull out zxJDBC in favor of jyjdbc??? or at least try it out
[18:52] <jimbaker> no, zxJDBC is tried, tested,forgotten
[18:52] <jimbaker> ;)
[18:52] <topi`> this one?
[18:52] <topi`> JayDeBeApi - A bridge from JDBC database drivers to Python DB-API.
[18:53] <jimbaker> topi`, no this - https://code.google.com/p/jyjdbc/
[18:53] <topi`> ok, Google code is your friend ;)
[18:54] <topi`> ok, so jyjdbc is the work of someone who was employed by Ingres
[18:55] <jimbaker> topi`, correct
[18:55] <topi`> I'd take that as a recommendation, then ;)
[18:55] <jimbaker> they might know something about database functionality
[18:56] <topi`> :)
[18:57] <topi`> entirely unlike me, who's a newcomer to the whole database field (I implemented *lots* of projects by just using pickle/cPickle as my backing store)
[18:57] <topi`> but... you just gotta love pickle ;)
[18:58] <topi`> I couldn't get the "ls" loop to exhaust anything, so I just killed the interpreter, it was draining all my battery :)
[18:59] <jimbaker> topi`, yes, it does a different type of resource exhaustion :)
[19:03] <topi`> jimbaker: any recommendations for installing jython in such a way that $JYTHONHOME/Lib gets automatically into sys.path?
[19:03] <topi`> see: IOError: [Errno 2] No such file or directory: '/home/topi/jython/jython.jar/Lib/distutils/__init__.py'
[19:04] <topi`> (this is because I did "jython traditional installer", but then overwrote the jython.jar with my jython-standalone.jar because I need the standalone when building django WARs
[19:04] <topi`> I have a virtualenv set up so that calling jython invokes that jython.jar but it evidently tries to *only* look inside that jar...
[19:05] <topi`> now my current "solution" is to define JYTHONPATH
[19:05] <topi`> did you understand why I needed jython-standalone.jar in that venv?
[19:05] <jimbaker> topi`, one thing that the singlejar support could add is to allow for additional libraries outside of site-packages
[19:05] <topi`> this is somewhat complex to explain...
[19:05] <jimbaker> that would be a fairly simple matter to add
[19:06] <topi`> I think distutils should be a fairly standard library, not?
[19:06] <topi`> and site-packages is just supposed to host the "contrib" libraries
[19:06] <jimbaker> the one thing i would like to do is better support site-packages, specifically namespace packages
[19:06] <jimbaker> although it's possible they might just work if simple
[19:07] <jimbaker> re war file support: i don't know. the last time i looked at this as a problem was 5 years ago :)
[19:07] <jimbaker> in terms of django. i assume if it's working??? it's working, i can do other things
[19:09] <topi`> I'm working on adding jyjdbc support to django-on-jython
[19:09] <topi`> as we speak
[19:11] <jimbaker> topi`, awesome!
[19:11] <topi`> I might get away with just cloning doj/backends/zxjdbc as jyjdbc and changing one import
[19:12] <topi`> in base.py
[19:21] <jimbaker> topi`, yeah, it appears that this should be the case. i don't want to suggest monkeypatching in pth files, because that support would be broken in clamp singlejar, at least until standalone mode in jython sees some more work
[19:32] <topi`> jimbaker: are there any specific codepaths for standalone? How does jython know to find Libs inside its own jar?
[19:33] <topi`> maybe the answer lies buried in jython's ant all-jars rule
[19:41] <topi`> grrr, the java.net.Inet4Address.isReachable requires sudo root
[19:41] <topi`> surely wouldn't work behind tomcat...
[19:44] <jimbaker> topi`, the standalone support does some interesting work w/ an extended classloader that can reach into the jython jar (if it detects it's running from this jar) and gets classes
[19:45] <jimbaker> but this cleverness knows nothing about .pth files
[19:46] <jimbaker> to workaround, singlejar puts everything in Lib/ in the single jar because this works w/ standalone
[19:46] <jimbaker> but that's just a shortterm fix, since it precludes certain types of import cleverness
[19:47] <topi`> oh
[19:47] <topi`> I try to avoid clever imports ;) they might break at python 4000 or whatever.
[19:50] * wandering (~I@cpc1-ward5-0-0-cust71.10-2.cable.virginmedia.com) has joined #jython
[19:50] <jimbaker> topi`, yeah, i think at this point, we should only let setuptools do clever import stuff
[19:50] <agronholm> what's a "clever import"?
[19:51] <jimbaker> i'm pretty certain that the way setuptools does namespace packages is compatible w/ what i have done
[19:51] <jimbaker> agronholm, well... there are so many ways to import in python/jython...
[19:51] <agronholm> and?
[19:51] <jimbaker> but in this case, i'm referring to the use of pth files
[19:52] <jimbaker> which allow for arbitrary running of code when stuff is being added to the classpath
[19:52] <jimbaker> so my singlejar support, in order to work around limitations of jython standalone support, ignores such extra cleverness
[19:53] <jimbaker> but if jython standalone support got better - and i did look at it briefly - then we could support as well
[19:57] <jimbaker> basically, clamp is setuptools-aware in terms of setuptools
[19:57] <jimbaker> conventions, but not full pth aware
[20:12] <topi`> jimbaker: ok, django is now running using jyjdbc :)
[20:13] <topi`> I had to remove "south" from installed apps though, for some odd reason it fails (empty south_db_adapters dictionary)
[20:13] <topi`> but hopefully using jyjdbc will slow down the exhaustion of PermGen memory inside tomcat
[20:14] <topi`> *and* the issue with running out of postgre connections
[20:14] <topi`> we should bring django-on-jython up to the current standards, including this patch for jyjdbc
[20:19] * thereisnospoon_ (~thereisno@27-33-1-87.tpgi.com.au) Quit (Read error: Operation timed out)
[20:25] <jimbaker> topi`, agreed absolutely on that!
[20:28] <sinsnare|zzZZzz> jimbaker: cool!
[20:28] <sinsnare|zzZZzz> as in clamp stuff
[20:28] * sinsnare|zzZZzz is now known as sinistersnare
[20:30] <jimbaker> sinistersnare, i will be migrating my romper project to it shortly, which will be a real exercise. (current clamp of course was extracted from romper)
[20:30] <jimbaker> i think the next steps w/ clamp is to support annotations
[20:31] <sinistersnare> cool
[20:31] * thereisnospoon_ (~thereisno@27-33-1-87.tpgi.com.au) has joined #jython
[20:31] <sinistersnare> well cant wait! ill test out some jython stuff after im finished with homework
[20:33] <jimbaker> other obvious steps: testing, testing, testing. although this is a spike, i don't want to throw away. better to refactor imho. then put into pypi
[20:33] <jimbaker> lastly, it would be cool to pull in maven support
[20:36] <topi`> sinistersnare: so, where's your libgdx stuff? do you plan on more features?
[20:36] <sinistersnare> topi`: right now its in my github as sinistersnare/pygdx i think, but i havent had time to touch any of that. tonight ill get some work on that
[20:36] <sinistersnare> theres not many things to add but docs on how to set it up and all that jazz
[20:37] <sinistersnare> its pretty straightforward if you get the libgdx API, so i might make a tutorial on libgdx for python programmers, would be cool
[20:40] <jimbaker> sinistersnare, i would like to see how far you can go with singlejar on android. i suspect there will be early roadblocks - basically wherever proxies are dynamically created. (a proxy is the piece between java and python that allows python classes that derive from java classes/interfaces.)
[20:40] <jimbaker> but it would be nice to see where they exist
[20:42] <jimbaker> it would be possible in certain cases to use this instead, http://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Proxy.html
[20:44] <jimbaker> see for example the code sample i show here, https://github.com/jimbaker/clamped#writing-a-python-class-to-use-clamp
[20:45] <sinistersnare> great
[20:45] <sinistersnare> ok better get to work, ima try to not be on irc til i finish :p
[21:13] * dso__ (~dso@75-63-109-65.uvs.hstntx.sbcglobal.net) Quit (Remote host closed the connection)
[21:35] * fluxdude (~fluxdude@unaffiliated/fluxdude) has joined #jython
[22:16] * Arfrever (~Arfrever@apache/committer/Arfrever) Quit (Ping timeout: 240 seconds)
[22:24] <jimbaker> looks like dynamic proxy support will be very straightforward
[22:25] <jimbaker> just a less efficient path
[22:49] * Arfrever (~Arfrever@apache/committer/Arfrever) has joined #jython
[23:07] <sinistersnare> cool
[23:07] <sinistersnare> im setting stuff up now (stealing the setup and ez_setup from clamped :p
[23:13] <jimbaker> sinistersnare, sounds good
[23:14] <jimbaker> so hopefully i can get dynamic proxy support done in the next few days
[23:14] <sinistersnare> is your jython-ssl branch gonna be merged by the 2.7 release you think?
[23:14] <sinistersnare> oh cool, that would be fun
[23:14] <jimbaker> sinistersnare, definitely going to be merged
[23:14] <sinistersnare> awesome!
[23:14] <jimbaker> it's really a requirement for 2.7 beta 2
[23:15] <jimbaker> jython w/o setuptools/pip/easy_install is not so useful
[23:15] <sinistersnare> yes, this will be cool
[23:15] <sinistersnare> will we have access to the cheeseshop?
[23:16] <sinistersnare> im guessing that jython specific libs would have to be marked as so?
[23:16] <jimbaker> sinistersnare, there's really no mechanism for such marking
[23:17] <jimbaker> but then again, there is this package
[23:17] <jimbaker> http://www.jyni.org/
[23:17] <jimbaker> which would be nice to see packaged in pypi
[23:18] <jimbaker> i don't know how this would work out on android, but supposedly android supports jni in some way
[23:19] <sinistersnare> android supports JNI, thats basically how libgdx works :p
[23:20] <sinistersnare> http://developer.android.com/training/articles/perf-jni.html
[23:21] <sinistersnare> and maybe we could convince PyPI people to add support for the jython tag like they have other tags
[23:22] <sinistersnare> Programming Language :: Jython :: 2.7
[23:22] <sinistersnare> which is a little backwards because the language is still Python, but people would get it easier :p
[23:25] <Arfrever> You can use combination of:
[23:25] <Arfrever> Programming Language :: Python :: 2.7
[23:25] <Arfrever> Programming Language :: Python :: Implementation :: Jython
[23:32] <sinistersnare> oh that sounds good too
[23:32] <sinistersnare> we should bug the PyPI guys for it :p
[23:32] <sinistersnare> i was pondering the idea of making a libgdx wrapper for jython. make it more pythonic and all
[23:32] <sinistersnare> would be cool
[23:33] <sinistersnare> yeah, i need to get my blog setup :p just installed clamp, lets try this out!
[23:46] <Arfrever> sinistersnare: Re "we should bug the PyPI guys for it": What do you mean?
[23:46] <sinistersnare> Arfrever: is there something along the lines of "Programming Language :: Python :: Implementation :: Jython " already?
[23:47] <Arfrever> sinistersnare: pypi.python.org -> "List trove classifiers"
[23:47] <sinistersnare> yup just found it! looks to be there
[23:47] <sinistersnare> sorry :p i thought you were suggesting it!
[23:47] <sinistersnare> ok thats good then, the groundwork is there!
[23:53] <sinistersnare> jimbaker: my 'jython-ssl setup.py build_jar' is giving some issues https://gist.github.com/sinistersnare/7b3316ba17b079f7094e
[23:53] <sinistersnare> it doesnt seem to want to find my jars
[23:54] <jimbaker> sinistersnare, you need to specify additional jars with --classpath
[23:55] <sinistersnare> ahhh yes, makes sense
[23:55] <jimbaker> fair warning: i haven't tested this part
[23:55] <jimbaker> so $ jython-ssl setup.py build_jar --classpath=???
[23:55] <sinistersnare> yes ok seems legit, lets see!
[23:55] <jimbaker> next up: add a jars keyword so even more good packaging support/magic
[23:56] <sinistersnare> check out the gist again, added that command. says --classpath not recognized
[23:59] <sinistersnare> and the jars keyword would be amazing magic
[23:59] <jimbaker> sinistersnare, ahh, not tested at its finest
[23:59] <jimbaker> i guess it's a placeholder :)
[23:59] <sinistersnare> :p ok, so how do you recommend i go about this? can i at all?
[23:59] <jimbaker> sinistersnare, yes, especially if maven dependencies could also be resolved

Index

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