Fix SF #659228, 'realpath' function missing from os.path

Also added realpath = abspath for os2emx, similar to windows/mac
which also don't really implement realpath.

Backport candidate, I think?
This commit is contained in:
Neal Norwitz 2003-01-03 18:01:57 +00:00
parent 5a22453d33
commit 61cdac6d3d
4 changed files with 8 additions and 4 deletions

View File

@ -7,7 +7,7 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime", "basename","dirname","commonprefix","getsize","getmtime",
"getatime","getctime", "islink","exists","isdir","isfile", "getatime","getctime", "islink","exists","isdir","isfile",
"walk","expanduser","expandvars","normpath","abspath", "walk","expanduser","expandvars","normpath","abspath",
"supports_unicode_filenames"] "realpath","supports_unicode_filenames"]
# Normalize the case of a pathname. Dummy in Posix, but <s>.lower() here. # Normalize the case of a pathname. Dummy in Posix, but <s>.lower() here.

View File

@ -13,7 +13,7 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime", "basename","dirname","commonprefix","getsize","getmtime",
"getatime","getctime", "islink","exists","isdir","isfile","ismount", "getatime","getctime", "islink","exists","isdir","isfile","ismount",
"walk","expanduser","expandvars","normpath","abspath","splitunc", "walk","expanduser","expandvars","normpath","abspath","splitunc",
"supports_unicode_filenames"] "realpath","supports_unicode_filenames"]
# Normalize the case of a pathname and map slashes to backslashes. # Normalize the case of a pathname and map slashes to backslashes.
# Other normalizations (such as optimizing '../' away) are not done # Other normalizations (such as optimizing '../' away) are not done

View File

@ -12,7 +12,7 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime", "basename","dirname","commonprefix","getsize","getmtime",
"getatime","getctime", "islink","exists","isdir","isfile","ismount", "getatime","getctime", "islink","exists","isdir","isfile","ismount",
"walk","expanduser","expandvars","normpath","abspath","splitunc", "walk","expanduser","expandvars","normpath","abspath","splitunc",
"supports_unicode_filenames"] "realpath","supports_unicode_filenames"]
# Normalize the case of a pathname and map slashes to backslashes. # Normalize the case of a pathname and map slashes to backslashes.
# Other normalizations (such as optimizing '../' away) are not done # Other normalizations (such as optimizing '../' away) are not done
@ -405,4 +405,7 @@ def abspath(path):
path = join(os.getcwd(), path) path = join(os.getcwd(), path)
return normpath(path) return normpath(path)
# realpath is a no-op on systems without islink support
realpath = abspath
supports_unicode_filenames = False supports_unicode_filenames = False

View File

@ -17,7 +17,8 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime", "basename","dirname","commonprefix","getsize","getmtime",
"getatime","getctime","islink","exists","isdir","isfile","ismount", "getatime","getctime","islink","exists","isdir","isfile","ismount",
"walk","expanduser","expandvars","normpath","abspath", "walk","expanduser","expandvars","normpath","abspath",
"samefile","sameopenfile","samestat","supports_unicode_filenames"] "samefile","sameopenfile","samestat",
"realpath","supports_unicode_filenames"]
# Normalize the case of a pathname. Trivial in Posix, string.lower on Mac. # Normalize the case of a pathname. Trivial in Posix, string.lower on Mac.
# On MS-DOS this may also turn slashes into backslashes; however, other # On MS-DOS this may also turn slashes into backslashes; however, other