null pointer exceptions

Tennessee James Leeuwenburg t.leeuwenburg at nothing.bom.gov.au
Fri Jul 18 06:32:10 CEST 2003


It seems to be the case that there are some null pointer exceptions which
Java can handle, but Jython can't. Which doesn't make sense to me, as with
Jython, it is Java which is doing the work.

Are there any good guides to this?

I have a class which includes adding an ImageIcon. If the required graphic
resource isn't present, there is a NullPointerException. Java doesn't care
- the straight Java program handles it internally and gets on with life.
But when I include it from Python, it explodes.

It may be because the resource is specified using a relative pathname.
When Jython executes, it may be not using the current directory as its'
base for relative paths, but could be using JYTHON_HOME, which could lead
to this behaviour.

Can anyone tell me what Jython uses for its' relative path base?
Can anyone describe how Jython handles exceptions that is different from
Java?

Thanks,
-Tennessee




More information about the Python-list mailing list