From cec632f359ca78e357606fc0938d8c8a7d3fe663 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Wed, 29 Jun 2016 22:53:51 -0700 Subject: [PATCH] Python 3 compatible formatting in `unique_path` --- beets/util/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beets/util/__init__.py b/beets/util/__init__.py index ba9445f8f..832d17942 100644 --- a/beets/util/__init__.py +++ b/beets/util/__init__.py @@ -496,7 +496,8 @@ def unique_path(path): num = 0 while True: num += 1 - new_path = b'%s.%i%s' % (base, num, ext) + suffix = u'.{}'.format(num).encode() + ext + new_path = base + suffix if not os.path.exists(new_path): return new_path