From 20bbab0b4c449c10d21b4388675f2bec775f4288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20M=C3=B8ller=20J=C3=B8rgensen?= Date: Thu, 23 Jul 2020 03:57:15 +0200 Subject: [PATCH] Update plat_other.py The trash info file needs to exist before the file is moved into the trash folder. This is to conform to the events based detection of trashed files in gnome and other file managers. --- send2trash/plat_other.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/send2trash/plat_other.py b/send2trash/plat_other.py index dd45606..73bda7e 100644 --- a/send2trash/plat_other.py +++ b/send2trash/plat_other.py @@ -110,11 +110,11 @@ def trash_move(src, dst, topdir=None): check_create(filespath) check_create(infopath) - - os.rename(src, op.join(filespath, destname)) + f = open(op.join(infopath, destname + INFO_SUFFIX), "w") f.write(info_for(src, topdir)) f.close() + os.rename(src, op.join(filespath, destname)) def find_mount_point(path):