]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #15845: Fix comparison between bytes and string.
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 8 Jan 2013 09:32:58 +0000 (11:32 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Tue, 8 Jan 2013 09:32:58 +0000 (11:32 +0200)
Lib/os.py

index d1101a26a0d87929f392ff22b48e74008a13369c..81e037af3cd4ee7188751236d9de2e120273803a 100644 (file)
--- 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)