I’m having problems getting the registry entry python.cachedir working with Jython 2.5 beta 4.
 
Jython is installed in /usr/local/jython25b4, writeable only by root. There’s a cachedir directory under jython25b4. I have a jar file nsutils.jar on my class path.
 
My $HOME/.jython contains
 
python.cachedir=/home/pxmayne/.jython.cachedir
 
The .jython registry file is being found by Jython, because if I add “python.verbose=debug”, I get debugging messages. The directory /home/pxmayne/.jython.cachedir exists and is empty.
 
Running my Jython script gives
 
*sys-package-mgr*: processing new jar, '/home/pxmayne/nsutils.jar'
*sys-package-mgr*: can't write cache file for '/home/pxmayne/nsutils.jar'
*sys-package-mgr*: can't write index file
 
but the script works.
 
If (as root) I rename /usr/local/jython25b4/cachedir to something else and rerun my script:
 
*sys-package-mgr*: can't create package cache dir, '/usr/local/jython25b4/cachedir/packages'
Traceback (most recent call last):
  File "./jmeas.py", line 20, in <module>
    import com.hp.nonstop.guardian as guardian
ImportError: No module named hp
 
and the script fails.
 
If I change the permissions of /usr/local/jython25b4/cachedir (and directories and files below that) to be world writeble, packages are correctly cached, but that isn’t an acceptable workaround.
 
If I change the definition of python.home in the Jython startup shell script from /usr/local/jython25b4 to $HOME (/home/pxmayne), then the packages are correctly cached in $HOME/.jython.cachedir and my script works. I’m not sure that that Is the right thing to do, though.
 
I’m using a custom simplified Jython startup shell script (due to the lack of bash on this system), so I may be missing something. (This doesn’t appear to be new to beta 4: our beta 3 install had “chmod 777 cachedir” to make things work, but it slipped my mind until now.)
 
Why isn’t my definition of python.cachedir being used?
 
Thanks.
 
PJDM
--
Peter Mayne
Hewlett-Packard
Canberra, ACT, Australia