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

Skip to content

Commit f6fb3a3

Browse files
Issue #15845: Fix comparison between bytes and string.
2 parents a2ad5c3 + 4ab23bf commit f6fb3a3

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
@@ -260,7 +260,10 @@ def makedirs(name, mode=0o777, exist_ok=False):
260260
# be happy if someone already created the path
261261
if e.errno != errno.EEXIST:
262262
raise
263-
if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists
263+
cdir = curdir
264+
if isinstance(tail, bytes):
265+
cdir = bytes(curdir, 'ASCII')
266+
if tail == cdir: # xxx/newdir/. exists if xxx/newdir exists
264267
return
265268
try:
266269
mkdir(name, mode)

0 commit comments

Comments
 (0)