Binary literals in unique_path (fix #1298)

This commit is contained in:
Adrian Sampson 2015-02-02 15:28:44 -08:00
parent 313c3807aa
commit 1b22f122a8

View file

@ -480,7 +480,7 @@ def unique_path(path):
return path
base, ext = os.path.splitext(path)
match = re.search(r'\.(\d)+$', base)
match = re.search(br'\.(\d)+$', base)
if match:
num = int(match.group(1))
base = base[:match.start()]
@ -488,7 +488,7 @@ def unique_path(path):
num = 0
while True:
num += 1
new_path = '%s.%i%s' % (base, num, ext)
new_path = b'%s.%i%s' % (base, num, ext)
if not os.path.exists(new_path):
return new_path