mirror of
https://github.com/beetbox/beets.git
synced 2026-01-03 22:42:44 +01:00
Binary literals in unique_path (fix #1298)
This commit is contained in:
parent
313c3807aa
commit
1b22f122a8
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue