Message6577

Author djain
Recipients djain
Date 2011-07-22.15:33:52
SpamBayes Score 2.0335678e-11
Marked as misclassified No
Message-id <1311348833.47.0.649001221694.issue1776@psf.upfronthosting.co.za>
In-reply-to
Content
Adding a JAR file to the classpath by appending its location to sys.path does not make the packages contained in the JAR available.

I thought this was related to #1455, which was supposedly fixed, but it doesn't work. In Jython 2.2, if somelib.jar was located in /path/to/somelib.jar and contained the package somepackage, one could do the following:

import sys
sys.path.append("/path/to/somelib.jar")
import somepackage

This will not work in either Jython 2.5.1 or 2.5.2 (somepackage is not available). 
However, if the class files are not in a JAR but in a directory, e.g. /path/to/somebin, it will also work with the two new releases:

import sys
sys.path.append("/path/to/somebin")
import somepackage

Works fine. 

You can try this with any JAR. So far I haven't found one I could import with 2.5.1/2.5.2.

Because the issue breaks backward compatibility with Jython 2.2 and I am unaware of an equally simple way of dynamically loading JARs, I consider this to be critical.
History
Date User Action Args
2011-07-22 15:33:53djainsetrecipients: + djain
2011-07-22 15:33:53djainsetmessageid: <1311348833.47.0.649001221694.issue1776@psf.upfronthosting.co.za>
2011-07-22 15:33:53djainlinkissue1776 messages
2011-07-22 15:33:52djaincreate