From: <bc...@wo...> - 2001-07-26 18:54:15
|
[Ype Kingma] >Under jython 21a2, Java 1.1.8, OS2 > > os.path.dirname('e:\\pyp\\pqp/pqdb.py' ) > >gives: > > 'e:\\pyp' > >but I expected pqp to be part of the result. >Obviously this is different from your result, so >the OS seems to have influence here. It is more likely a java1/java2 thing. Both on windows: Jython 2.1a2 on java1.4.0-beta (JIT: null) Type "copyright", "credits" or "license" for more information. >>> from java.io import File >>> f = File('e:\\pyp\\pqp/pqdb.py') >>> f e:\pyp\pqp\pqdb.py >>> Jython 2.1a2 on java1.1.7A (JIT: symcjit) Type "copyright", "credits" or "license" for more information. >>> from java.io import File >>> f = File('e:\\pyp\\pqp/pqdb.py') >>> f e:\pyp\pqp/pqdb.py >>> I'm not quite convinced that jython should try to worm around this issue in dirname. Can't you fix the problem at its origin by using os.sep and os.path.join to create the path? >I tried to find how this influence is programmed >into the jython environment, but I could not find it >because module os is written in java, but it does not >seem to have a special provision for os.path. The "os" is just renaming the Lib/javaos.py file. os.path is loaded from Lib/javapath.py >On renaming package dirs (see previous post): > >The module attribute __file__ contains the old path >name for an imported compiled module, which is >no more correct when the package and package directory >have been renamed. It seems to match CPython on this point. regards, finn |