mirror of
https://github.com/arsenetar/send2trash.git
synced 2025-03-12 14:44:35 +00:00
Fix bug in send2trash: Use os.fsdecode() in shutil.move()
`shutil.move()` function expects string paths, not byte paths. This bug is leading to failure when src and dst are on on the different file system.
This commit is contained in:
parent
0a48c26f68
commit
baeb9e59f9
@ -115,7 +115,7 @@ def trash_move(src, dst, topdir=None, cross_dev=False):
|
|||||||
f.write(info_for(src, topdir))
|
f.write(info_for(src, topdir))
|
||||||
destpath = op.join(filespath, destname)
|
destpath = op.join(filespath, destname)
|
||||||
if cross_dev:
|
if cross_dev:
|
||||||
shutil.move(src, destpath)
|
shutil.move(fsdecode(src), fsdecode(destpath))
|
||||||
else:
|
else:
|
||||||
os.rename(src, destpath)
|
os.rename(src, destpath)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user