From: Serhiy Storchaka Date: Tue, 8 Jan 2013 09:32:58 +0000 (+0200) Subject: Issue #15845: Fix comparison between bytes and string. X-Git-Tag: v3.2.4rc1~245 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ab23bfbeb94f1ade79def3d096ed2daaea6bc79;p=thirdparty%2FPython%2Fcpython.git Issue #15845: Fix comparison between bytes and string. --- diff --git a/Lib/os.py b/Lib/os.py index d1101a26a0d8..81e037af3cd4 100644 --- a/Lib/os.py +++ b/Lib/os.py @@ -146,7 +146,10 @@ def makedirs(name, mode=0o777, exist_ok=False): # be happy if someone already created the path if e.errno != errno.EEXIST: raise - if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists + cdir = curdir + if isinstance(tail, bytes): + cdir = bytes(curdir, 'ASCII') + if tail == cdir: # xxx/newdir/. exists if xxx/newdir exists return try: mkdir(name, mode)