From b6cb3653f8811949e96557c88e2e9f4b0c479972 Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Thu, 19 Aug 2021 17:13:11 -0500 Subject: [PATCH] fix trash_move this bug prevents using jupyter* in research environments where file systems aren't always local e.g. https://github.com/jupyterlab/jupyterlab/issues/5781 and our own use at https://cri.uchicago.edu/ cc @annawoodard --- send2trash/plat_other.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/send2trash/plat_other.py b/send2trash/plat_other.py index 37dd211..d75de57 100644 --- a/send2trash/plat_other.py +++ b/send2trash/plat_other.py @@ -112,7 +112,8 @@ def trash_move(src, dst, topdir=None): with open(op.join(infopath, destname + INFO_SUFFIX), "w") as f: f.write(info_for(src, topdir)) - os.rename(src, op.join(filespath, destname)) + shutil.copy(src, op.join(filespath, destname)) + os.remove(src) def find_mount_point(path):