[Python-checkins] r78793 - python/branches/py3k/Lib/macpath.py

florent.xicluna python-checkins at python.org
Mon Mar 8 13:25:35 CET 2010


Author: florent.xicluna
Date: Mon Mar  8 13:25:35 2010
New Revision: 78793

Log:
Fix macpath to deal with bytes


Modified:
   python/branches/py3k/Lib/macpath.py

Modified: python/branches/py3k/Lib/macpath.py
==============================================================================
--- python/branches/py3k/Lib/macpath.py	(original)
+++ python/branches/py3k/Lib/macpath.py	Mon Mar  8 13:25:35 2010
@@ -172,7 +172,11 @@
 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


More information about the Python-checkins mailing list