diff -r 815b88454e3e Lib/glob.py --- a/Lib/glob.py Fri Aug 31 17:14:31 2012 -0400 +++ b/Lib/glob.py Sun Sep 02 03:10:30 2012 +0100 @@ -60,7 +60,7 @@ return fnmatch.filter(names, pattern) def glob0(dirname, basename): - if basename == '': + if len(basename) == 0: # `os.path.split()` returns an empty basename for paths ending with a # directory separator. 'q*x/' should match only directories. if os.path.isdir(dirname): diff -r 815b88454e3e Lib/os.py --- a/Lib/os.py Fri Aug 31 17:14:31 2012 -0400 +++ b/Lib/os.py Sun Sep 02 03:10:30 2012 +0100 @@ -260,7 +260,10 @@ # 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)