Message2488

Author cgroves
Recipients
Date 2006-05-26.03:29:52
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The classloader passed into PySystemState.initialize is
ignored by BytecodeLoader.  This has bitten me twice. 
First, if the Jython classes aren't on the default
system classpath but instead on the classpath passed
into initialize, Jython blows up while initializing. 
Somewhere in creating its internal set of Python
exceptions it throws a NullPointerException.  Second,
the java proxies don't see items in the classloader
passed into initialize.  This got me when I had a
Jython class attempting to use ResourceBundle.getBundle
to retrieve a bundle only on the loader passed to
initialize.  Since the bundle wasn't on the Jython
class loader, things blew up.

The attached patch fixes both of these issues by
creating the BytecodeLoader2 with the classloader
passed into initialize as its parent.  The only
problems I can forsee with this is if someone passes in
a classloader to initialize that doesn't have the
default classloader as its parent and expects items on
the default loader to be available as they are now. 
I'm not sure how likely this is since I'm not sure what
the current usage of the classloader parameter is.
History
Date User Action Args
2008-02-20 17:18:31adminlinkissue1495299 messages
2008-02-20 17:18:31admincreate