From: Dominik J. <re...@bu...> - 2011-07-22 15:34:01
|
New submission from Dominik Jain <dj...@gm...>: 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. ---------- components: Core messages: 6577 nosy: djain severity: critical status: open title: Packages in JARs that are dynamically added to sys.path cannot be imported type: behaviour versions: 2.5.1, 2.5.2 _______________________________________ Jython tracker <re...@bu...> <http://bugs.jython.org/issue1776> _______________________________________ |