send2trash icon indicating copy to clipboard operation
send2trash copied to clipboard

Issue with partitioned drive

Open Wintg005 opened this issue 10 years ago • 12 comments

Just was curious to see if folks had issues with partitioned drives and sending to the bin. Currently using the script and its working great on my local drive but for some reason my partitioned drive is having issues. The files are being removed but not sent to the bin. Thanks for any advice!

Wintg005 avatar Jun 04 '15 15:06 Wintg005

Some more details would probably not hurt, such as your operating system and what you mean by "partitioned drive" (partition type, formats used in each partition, etc.)

ghost avatar Jun 04 '15 17:06 ghost

Sorry, on one machine Im getting "OSError: Couldn't perform operation. Error Code: 2." On another machine the files delete fine with no error code. Im trying to get rid of wav files. Looking at a Local NTFS drive. Let me know if there any other details I can provide

Wintg005 avatar Jun 04 '15 17:06 Wintg005

On Windows?

ghost avatar Jun 04 '15 17:06 ghost

yep windows.

Wintg005 avatar Jun 04 '15 17:06 Wintg005

the odd thing is that the partioned drive works on another machine. It removes the files but doesnt send them to the trash. on the first machine I get that error.

Wintg005 avatar Jun 04 '15 18:06 Wintg005

I will probably not be the one fixing this issue, I don't use Windows, but it seems to me that there's enough details in this ticket to get somewhere.

ghost avatar Jun 04 '15 18:06 ghost

Sounds good. Thanks for the info on what else folks may need! Also, scratch the OSerror issue. All seems to be working ok in general. That error was unrelated to the un partitioned drive issue.

Wintg005 avatar Jun 04 '15 18:06 Wintg005

Using send2trash on Linux with an NTFS formatted drive mounted:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/send2trash/plat_gio.py", line 17, in send2trash
    f.trash(cancellable=None)
gi.repository.GLib.GError: g-io-error-quark: Unable to find or create trash directory /run/media/name/Seagate Backup Plus Drive/.Trash-1000 to trash /run/media/name/Seagate Backup Plus Drive/NewArchive/#ペン (405) (15)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/name/pixiv-clean/post-move-cleanup.py", line 253, in <module>
    init_config_with_ids_and_names(newarchive_dir_list, name_config_file)
  File "/home/name/pixiv-clean/post-move-cleanup.py", line 121, in init_config_with_ids_and_names
    send2trash(entry_path)
  File "/usr/lib/python3.8/site-packages/send2trash/plat_gio.py", line 22, in send2trash
    raise TrashPermissionError("")
send2trash.exceptions.TrashPermissionError: [Errno 13] Permission denied: ''

EDIT: This issue may be more related to #67 than this issue, apologies.

biggestsonicfan avatar Mar 04 '22 13:03 biggestsonicfan

@cglmrfreeman This error looks like there are not permissions to create the trash directory (or access an existing one) on the drive where the file is being trashed.

arsenetar avatar May 01 '22 01:05 arsenetar

@cglmrfreeman This error looks like there are not permissions to create the trash directory (or access an existing one) on the drive where the file is being trashed.

I thought that was obvious? The error is literally Unable to find or create trash directory /run/media/name/Seagate Backup Plus Drive/.Trash-1000. The question is: Why?

biggestsonicfan avatar May 01 '22 05:05 biggestsonicfan

@cglmrfreeman, does the user you were running send2trash with have permissions to the drive in your error? This should only happen if the permissions on the drive do not allow you to create and/or read the directory that is trying to be used. If the user does not have permissions this is the expected behavior.

arsenetar avatar May 01 '22 05:05 arsenetar

The user has permissions, and I have been using python to create, move, copy, and delete files on that drive. Send2trash was the only thing that has failed for me regarding some automated script cleanup I was working on.

EDIT: I have since moved from the ntfs mounting driver to the ntfs3 mounting driver and can no longer reproduce this behavior.

biggestsonicfan avatar May 01 '22 05:05 biggestsonicfan