mirror of
https://github.com/beetbox/beets.git
synced 2025-12-24 09:33:46 +01: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:
parent
592c3fa356
commit
de3eedc033
1 changed files with 2 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue