Message1277

Author pdrummond
Recipients
Date 2006-11-20.21:09:52
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Here's more background info on how this strange behaviour came to be from the mailing list (I would have just linked to the post online rather than paste it here but sourceforge archives are out-of-date.

In the DeveloperGuide it says to make the following script to run jython:

--------------------
#!/bin/sh
exec java -Dpython.home=<path>/dist/ -jar <path>/dist/jython.jar $*
--------------------

Well, by going down this route I get into many problems which would take a 
while to explain!  What I have done instead is the following:

--------------------
exec 
java -Dpython.path=/home/pdrummond/bin/Python-2.3.6/Lib -jar /home/pdrummond/src/jython/2.3/dist/jython.jar 
$*
--------------------

Rather than specify python.home I have just set the python path to point to 
the python lib directory.  This works as I can successfully run 
dist/Lib/test/regrtest.py now.  However, when I inspect the sys.path in the 
jython console, the output is weird:

----------------------------
dist> jython
Jython 2.3a0 on java1.5.0_08 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> >>> import sys.path; print sys.path
['', '/home/pdrummond/src/jython/2.3/dist/.', '/home/pdrummond/src/jython/2.3/dist/Lib', '/home/pdrummond/bin/Python-2.3.6/Lib', '/home/pdrummond/src/jython/2.3/dist/__classpath__']
>>> >>>
----------------------------
Looks like "/home/pdrummond/src/jython/2.3/dist is being prefixed to 
everything!  If I remove the python.path property from the exec script and 
instead specify python.path in the registry file then everything works fine:

----------------------------
bash> cat bin/jython
#!/bin/sh
exec java -jar /home/pdrummond/src/jython/2.3/dist/jython.jar $*

bash> head 2.3/dist/registry
# Python Registry -*- ksh -*-
# This default registry sets many common options to their default values
# All of these settings could be erased with no change in behavior
python.path=/home/pdrummond/Python-2.3.6/Lib

bash> jython
Jython 2.3a0 on java1.5.0_08 (JIT: null)
>>> >>> import sys;print sys.path
['', '.', '/home/pdrummond/src/jython/2.3/dist/Lib', '/home/pdrummond/Python-2.3.6/Lib', '__classpath__']
>>> >>>     
----------------------------

Note that I must put the registry file in "dist" for jython to pick it up.  

To summarize, specifying python.path in the registry works but specifying it 
as a property doesn't!  

Cheers,
Paul Drummond



 











-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jython-dev mailing list
Jython-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-dev

History
Date User Action Args
2008-02-20 17:17:35adminlinkissue1599012 messages
2008-02-20 17:17:35admincreate