From 1b22f122a8a56fd82dabd649a7fed50110b360c8 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 2 Feb 2015 15:28:44 -0800 Subject: [PATCH] Binary literals in unique_path (fix #1298) --- beets/util/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beets/util/__init__.py b/beets/util/__init__.py index f6396f9da..01a0257b0 100644 --- a/beets/util/__init__.py +++ b/beets/util/__init__.py @@ -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