1
0
镜像自地址 https://github.com/arsenetar/send2trash.git 已同步 2026-03-24 07:21:37 +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.
这个提交包含在:
Yogesh Agarwala
2024-03-23 05:37:21 +05:30
提交者 GitHub
父节点 0a48c26f68
当前提交 baeb9e59f9

查看文件

@@ -115,7 +115,7 @@ def trash_move(src, dst, topdir=None, cross_dev=False):
f.write(info_for(src, topdir))
destpath = op.join(filespath, destname)
if cross_dev:
shutil.move(src, destpath)
shutil.move(fsdecode(src), fsdecode(destpath))
else:
os.rename(src, destpath)