]> granicus.if.org Git - python/commitdiff
Issue #8179: Fix macpath.realpath() on a non-existing path.
authorFlorent Xicluna <florent.xicluna@gmail.com>
Sun, 21 Mar 2010 12:27:20 +0000 (12:27 +0000)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Sun, 21 Mar 2010 12:27:20 +0000 (12:27 +0000)
Lib/macpath.py
Misc/NEWS

index 15714c6c2cd55ed9d68cd6dca80a8c736db22430..b22759efc32b58b1fa3751841d8edd22e3250496 100644 (file)
@@ -206,7 +206,10 @@ def realpath(path):
     path = components[0] + ':'
     for c in components[1:]:
         path = join(path, c)
-        path = Carbon.File.FSResolveAliasFile(path, 1)[0].as_pathname()
+        try:
+            path = Carbon.File.FSResolveAliasFile(path, 1)[0].as_pathname()
+        except Carbon.File.Error:
+            pass
     return path
 
 supports_unicode_filenames = False
index 4221ee2aad6cc1ef996a78be87b7af5cafa10eb2..d8c18c896f85bfdf87a00a9f429158c20cb954ee 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -24,6 +24,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #8179: Fix macpath.realpath() on a non-existing path.
+
 - Issue #8024: Update the Unicode database to 5.2.
 
 - Issue #8104: socket.recv_into() and socket.recvfrom_into() now support