diff --git a/Lib/macpath.py b/Lib/macpath.py index ba9d40b7436..e3145da1295 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 .lower() here. diff --git a/Lib/ntpath.py b/Lib/ntpath.py index d6b69208df4..b82051424e2 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 0315da027fa..f92841fd5f9 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 8da9fdaa8c2..d0179f112cb 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