diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2003-01-03 18:01:57 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2003-01-03 18:01:57 (GMT) |
commit | 61cdac6d3d00b4a1b34c64b2fae0e1be10b5fdb4 (patch) | |
tree | 15425e731b90df1018ad164bff00cb91b9552e06 /Lib | |
parent | 5a22453d332e61cb2dd743712354defe6a37bdf1 (diff) | |
download | cpython-61cdac6d3d00b4a1b34c64b2fae0e1be10b5fdb4.zip cpython-61cdac6d3d00b4a1b34c64b2fae0e1be10b5fdb4.tar.gz cpython-61cdac6d3d00b4a1b34c64b2fae0e1be10b5fdb4.tar.bz2 |
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?
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/macpath.py | 2 | ||||
-rw-r--r-- | Lib/ntpath.py | 2 | ||||
-rw-r--r-- | Lib/os2emxpath.py | 5 | ||||
-rw-r--r-- | Lib/posixpath.py | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/Lib/macpath.py b/Lib/macpath.py index ba9d40b..e3145da 100644 --- a/Lib/macpath.py +++ b/Lib/macpath.py @@ -7,7 +7,7 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","getctime", "islink","exists","isdir","isfile", "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. diff --git a/Lib/ntpath.py b/Lib/ntpath.py index d6b6920..b820514 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -13,7 +13,7 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","getctime", "islink","exists","isdir","isfile","ismount", "walk","expanduser","expandvars","normpath","abspath","splitunc", - "supports_unicode_filenames"] + "realpath","supports_unicode_filenames"] # Normalize the case of a pathname and map slashes to backslashes. # Other normalizations (such as optimizing '../' away) are not done diff --git a/Lib/os2emxpath.py b/Lib/os2emxpath.py index 0315da0..f92841f 100644 --- a/Lib/os2emxpath.py +++ b/Lib/os2emxpath.py @@ -12,7 +12,7 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","getctime", "islink","exists","isdir","isfile","ismount", "walk","expanduser","expandvars","normpath","abspath","splitunc", - "supports_unicode_filenames"] + "realpath","supports_unicode_filenames"] # Normalize the case of a pathname and map slashes to backslashes. # Other normalizations (such as optimizing '../' away) are not done @@ -405,4 +405,7 @@ def abspath(path): path = join(os.getcwd(), path) return normpath(path) +# realpath is a no-op on systems without islink support +realpath = abspath + supports_unicode_filenames = False diff --git a/Lib/posixpath.py b/Lib/posixpath.py index 8da9fda..d0179f1 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -17,7 +17,8 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","getctime","islink","exists","isdir","isfile","ismount", "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. # On MS-DOS this may also turn slashes into backslashes; however, other |