]> granicus.if.org Git - python/commitdiff
Fix macpath to deal with bytes
authorFlorent Xicluna <florent.xicluna@gmail.com>
Mon, 8 Mar 2010 12:25:35 +0000 (12:25 +0000)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Mon, 8 Mar 2010 12:25:35 +0000 (12:25 +0000)
Lib/macpath.py

index c02364624436ab84c7d8ca267ea5425043671408..f58a19579238d140a073790ff06ad53e429623e4 100644 (file)
@@ -172,7 +172,11 @@ def normpath(s):
 def abspath(path):
     """Return an absolute path."""
     if not isabs(path):
-        path = join(os.getcwd(), path)
+        if isinstance(path, bytes):
+            cwd = os.getcwdb()
+        else:
+            cwd = os.getcwd()
+        path = join(cwd, path)
     return normpath(path)
 
 # realpath is a no-op on systems without islink support