Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1a03ac8

Browse files
Issue #15845: Fix comparison between bytes and string.
Patch by Alessandro Moura.
2 parents 1573842 + f6fb3a3 commit 1a03ac8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/os.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ def makedirs(name, mode=0o777, exist_ok=False):
236236
# be happy if someone already created the path
237237
if e.errno != errno.EEXIST:
238238
raise
239-
if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists
239+
cdir = curdir
240+
if isinstance(tail, bytes):
241+
cdir = bytes(curdir, 'ASCII')
242+
if tail == cdir: # xxx/newdir/. exists if xxx/newdir exists
240243
return
241244
try:
242245
mkdir(name, mode)

0 commit comments

Comments
 (0)