send2trash icon indicating copy to clipboard operation
send2trash copied to clipboard

File is removed but not to the recycle bin

Open stylerhall opened this issue 1 year ago • 3 comments

I'm on Windows 11, Python 3.7/3.9/3.10/3.11. I'm using the send2trash module, and while the file is removed, it is not placed in the recycle bin/trash.

stylerhall avatar Sep 10 '24 13:09 stylerhall

In case if I used folder, mounted like network drive - I have the same problem. For example: \PC Name\C$\Data\Folder - I have the same problem C:\Data\Folder - it works correctly

ArtemStanovov avatar Oct 31 '24 18:10 ArtemStanovov

When I used Python 3.11.9 and Send2Trash 1.8.3 on Windows 11 to delete 70,000 files one by one, the following exception occurred only once, and the files were deleted but not moved to the trash.

"[WinError -2147024816] File exists."

The code used for testing is as follows.

try: send2trash.send2trash(local_file) logger.info(f"Transfer successful: {filename}") break except Exception as e: logger.error(f"Error moving to trash: {e}") break

hisabojp avatar Feb 07 '25 08:02 hisabojp

My RAM Disk (ImDisk) on Windows 10 also has the same issue. No errors or anything, just gets deleted.

huntfx avatar Nov 17 '25 07:11 huntfx