mirror of
https://github.com/beetbox/beets.git
synced 2026-12-01 07:28:02 -06:00
Use bytes for destination base name
This is mostly "defensive programming": clients *should* only call this on bytestring paths, but just in case this gets called on a Unicode string path, we should now not crash.
This commit is contained in:
@@ -496,8 +496,9 @@ def move(path, dest, replace=False):
|
||||
os.replace(path, dest)
|
||||
except OSError:
|
||||
# Copy the file to a temporary destination.
|
||||
base = os.path.basename(bytestring_path(dest))
|
||||
tmp = tempfile.NamedTemporaryFile(suffix=b'.beets',
|
||||
prefix=b'.' + os.path.basename(dest),
|
||||
prefix=b'.' + base,
|
||||
dir=os.path.dirname(dest),
|
||||
delete=False)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user