From: <bc...@wo...> - 2002-02-26 15:04:25
|
[Dinu Gherman] >Hi, > >I'm just starting to use Jython on OS X and run into several >problems, obne of them being this: > >[localhost:~] dinu% jython >Jython 2.1 on java1.3.1 (JIT: null) >Type "copyright", "credits" or "license" for more information. >>>> import os >>>> os.chdir('..') >Traceback (innermost last): > File "<console>", line 1, in ? > File "/Applications/Additions/Jython-2.1/Lib/javaos.py", line 56, in chdir >OSError: [Errno 0] chdir not supported in Java: .. >>>> > >Any ideas? As Samuele has explained, we can't do a chdir in 100% java and we will *never* include JNI code with the jython distribution. But we could (as we already do for the readline module) include support code that require the presence of a JNI module to work. So if anybody needed chdir() or chmod() or the full stat() values badly enough, she could create a copy of the javaos.py module that used one of the JNI module (there are several such candidates). We could then add a mechanisme to jython (in the registry) that allowed users to choose either the existing 100% pure java version of "os" or one the JNI alternatives. The fact that I haven't maintained jnios for quite a while should be a good indication that I don't need chdir() myself. regards, finn |