Skip to content

Commit

Permalink
Fixed can't concat str to byte inside move
Browse files Browse the repository at this point in the history
`os.path.basename` returns the same type that was used.

So, I have no guarantee that I needed here: `b'.''` or `'.'`.

Let use something universal ;)

Closes beetbox#4168
  • Loading branch information
catap committed Dec 8, 2021
1 parent 7364437 commit f10cd43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions beets/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ def move(path, dest, replace=False):
try:
os.replace(path, dest)
except OSError:
tmp = tempfile.mktemp(suffix='.beets',
prefix=py3_path(b'.' + os.path.basename(dest)),
dir=py3_path(os.path.dirname(dest)))
tmp = tempfile.mktemp(suffix=py3_path('.beets'),
prefix=py3_path('.') + os.path.basename(py3_path(dest)),
dir=os.path.dirname(py3_path(dest)))
tmp = syspath(tmp)
try:
shutil.copyfile(path, tmp)
Expand Down

0 comments on commit f10cd43

Please sign in to comment.