Message4809

Author boisgera
Recipients boisgera
Date 2009-06-11.09:16:39
SpamBayes Score 3.14833e-09
Marked as misclassified No
Message-id <1244711800.59.0.368004443637.issue1373@psf.upfronthosting.co.za>
In-reply-to
Content
Resource files in jars that are added via sys.path won't be found by
getRessource. Consider the pck.jar file that contains pck/Main.java and
the resource pck/Main.txt:

    >>> import sys
    >>> sys.path.append("pck.jar")
    >>> import pck
    *sys-package-mgr*: processing new jar,
'/home/boisgera/SANDBOX/JYTHON-BUGS/RESOURCE/pck.jar'
    >>> pck.Main.getResource("Main.txt") is None
    True
    >>> pck.Main.getClassLoader()
    org.python.core.SyspathJavaLoader@13d21d6

On the other hand, if 'pck.jar' is already in the CLASSPATH, I end up with:

    >>> import pck
    >>> pck.Main.getResource("Main.txt")
   
jar:file:/home/boisgera/SANDBOX/JYTHON-BUGS/RESOURCE/pck.jar!/pck/Main.txt
    >>> pck.Main.getClassLoader()
    sun.misc.Launcher$AppClassLoader@17182c1

I guess that 'findResource' should be implemented in SyspathJavaLoader
for this to work. The method 'getResourceAsStream' being already
implemented, I guess that most of the work has already been done ... right ?
History
Date User Action Args
2009-06-11 09:16:40boisgerasetrecipients: + boisgera
2009-06-11 09:16:40boisgerasetmessageid: <1244711800.59.0.368004443637.issue1373@psf.upfronthosting.co.za>
2009-06-11 09:16:40boisgeralinkissue1373 messages
2009-06-11 09:16:39boisgeracreate