postcards icon indicating copy to clipboard operation
postcards copied to clipboard

PermissionError, file used by another process

Open dalhei-lama opened this issue 2 years ago • 3 comments

Hey, so basically I think I managed to install the package and more or less make it work, but it seems like two tasks are trying to interact with the same file at the same time, and it gives an error : File "C:\Users\sdalh\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\postcards\plugin_folder\postcards_folder.py", line 119, in _move_to_sent os.rename(image_path, sent_img_path) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:/Users/sdalh/OneDrive/Pictures/Postcards\\fond ecran 3.jpg' -> 'C:/Users/sdalh/OneDrive/Pictures/Postcards\\sent\\fond ecran 3.jpg'

I'm not sure if it is a real problem and prevents the postcard to be sent, but the picture does not appear in the "sent" folder.

Also, if the postcard got sent, shouldn't we be able to manually send one via the official app ?

Thanks again for your work and support !

dalhei-lama avatar Oct 24 '23 11:10 dalhei-lama

The command output will indicate if a postcard is sent. You may increase verbosity level to get more command output (see help command). I suggest you run in this in a Unix-like environment such as Linux subsystem for Windows (although never tested), or use Linux.

Also, if the postcard got sent, shouldn't we be able to manually send one via the official app ?

Yes.

abertschi avatar Oct 24 '23 11:10 abertschi

Hey, I managed to send myself some postcards, but I think the problem is that I just need to close the process using the image or "delay" the next process : I also understand that the error refers to the lines 65 and 119 of the postcards_folder code. Do you have an idea of what I should edit in the code so that it works ? Like a "delay" or "close" command...

SBBBEGRUSSTSIE avatar Nov 13 '23 15:11 SBBBEGRUSSTSIE

but I think the problem is that I just need to close the process using the image or "delay" the next process :

I dont understand, can you elaborate what you do? What plugin/ command do you use to send the card? Is this on Windows?

abertschi avatar Nov 13 '23 17:11 abertschi