From: <pj...@us...> - 2008-11-12 02:22:16
|
Revision: 5572 http://jython.svn.sourceforge.net/jython/?rev=5572&view=rev Author: pjenvey Date: 2008-11-12 01:31:02 +0000 (Wed, 12 Nov 2008) Log Message: ----------- more java integration unicode vs str fixes Modified Paths: -------------- trunk/jython/Lib/ntpath.py trunk/jython/Lib/os.py trunk/jython/Lib/posixpath.py Modified: trunk/jython/Lib/ntpath.py =================================================================== --- trunk/jython/Lib/ntpath.py 2008-11-11 23:25:25 UTC (rev 5571) +++ trunk/jython/Lib/ntpath.py 2008-11-12 01:31:02 UTC (rev 5572) @@ -9,6 +9,7 @@ import os import stat import sys +from org.python.core.Py import newString __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", @@ -493,7 +494,8 @@ if not splitunc(path)[0] and not splitdrive(path)[0]: # cwd lacks a UNC mount point, so it should have a drive # letter (but lacks one): determine it - drive = splitdrive(java.io.File(path).getCanonicalPath())[0] + canon_path = newString(java.io.File(path).getCanonicalPath()) + drive = splitdrive(canon_path)[0] path = join(drive, path) return normpath(path) Modified: trunk/jython/Lib/os.py =================================================================== --- trunk/jython/Lib/os.py 2008-11-11 23:25:25 UTC (rev 5571) +++ trunk/jython/Lib/os.py 2008-11-12 01:31:02 UTC (rev 5572) @@ -237,7 +237,7 @@ Return a string representing the current working directory. """ - return sys.getCurrentWorkingDir() + return asPyString(sys.getCurrentWorkingDir()) def chdir(path): """chdir(path) Modified: trunk/jython/Lib/posixpath.py =================================================================== --- trunk/jython/Lib/posixpath.py 2008-11-11 23:25:25 UTC (rev 5571) +++ trunk/jython/Lib/posixpath.py 2008-11-12 01:31:02 UTC (rev 5572) @@ -14,6 +14,7 @@ import java.io.IOException import os import stat +from org.python.core.Py import newString __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", @@ -218,8 +219,8 @@ if not os._native_posix: def samefile(f1, f2): """Test whether two pathnames reference the same actual file""" - canon1 = java.io.File(_ensure_str(f1)).getCanonicalPath() - canon2 = java.io.File(_ensure_str(f2)).getCanonicalPath() + canon1 = newString(java.io.File(_ensure_str(f1)).getCanonicalPath()) + canon2 = newString(java.io.File(_ensure_str(f2)).getCanonicalPath()) return canon1 == canon2 else: def samefile(f1, f2): @@ -448,7 +449,7 @@ encounter a path we've seen before (meaning that there's a loop). """ try: - return str(java.io.File(abspath(path)).getCanonicalPath()) + return newString(java.io.File(abspath(path)).getCanonicalPath()) except java.io.IOException: return None else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |