From: Florent Xicluna Date: Mon, 8 Mar 2010 12:25:35 +0000 (+0000) Subject: Fix macpath to deal with bytes X-Git-Tag: v3.2a1~1531 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19b02d4558515e761755346dd1c119cf6ad55352;p=python Fix macpath to deal with bytes --- diff --git a/Lib/macpath.py b/Lib/macpath.py index c023646244..f58a195792 100644 --- a/Lib/macpath.py +++ b/Lib/macpath.py @@ -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