]> granicus.if.org Git - python/commitdiff
Fix SF #659228, 'realpath' function missing from os.path
authorNeal Norwitz <nnorwitz@gmail.com>
Fri, 3 Jan 2003 18:01:57 +0000 (18:01 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Fri, 3 Jan 2003 18:01:57 +0000 (18:01 +0000)
Also added realpath = abspath for os2emx, similar to windows/mac
which also don't really implement realpath.

Backport candidate, I think?

Lib/macpath.py
Lib/ntpath.py
Lib/os2emxpath.py
Lib/posixpath.py

index ba9d40b74361d2db5204d290d58413b340e7c7c5..e3145da129533dde33210f871d7103b08a5ce6a0 100644 (file)
@@ -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.
 
index d6b69208df4e870947c4a5ffef1eb5429ab3ef73..b82051424e28eac703faacf9e9f39578d3f0069d 100644 (file)
@@ -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
index 0315da027fa4d7ac87c351ae0e8d7cd7be36882f..f92841fd5f9eca507770a7453e199c16de41556d 100644 (file)
@@ -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
index 8da9fdaa8c21c15bcd7633da14f08644122b48bc..d0179f112cbfad513e86583393009a6bb65be3e5 100644 (file)
@@ -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