Narrat / Pim

PyGObject based image viewer with vim-like keybindings
MIT License
28 stars 9 forks source link

Removal of an invalidated path shouldn't trigger physical deletion #26

Closed Narrat closed 3 years ago

Narrat commented 3 years ago
:: Error: Couldn't open /path/to/no/longer/existing/picture.jpg
Traceback (most recent call last):
  File "/usr/lib/python3.9/shutil.py", line 806, in move
    os.rename(src, real_dst)
FileNotFoundError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/path/to/no/longer/existing/picture.jpg' -> '/home/omnius/.local/share/Trash/files/8f0833a5e9a848d69f14d50d29e88844'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pim", line 219, in handle_key
    action[0](*action[1:])
  File "/usr/bin/pim", line 245, in move_index
    delete()
  File "/usr/bin/pim", line 133, in delete
    shutil.move(path, TRASH + '/files/' + name)
  File "/usr/lib/python3.9/shutil.py", line 820, in move
    copy_function(src, real_dst)
  File "/usr/lib/python3.9/shutil.py", line 435, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.9/shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/path/to/no/longer/existing/picture.jpg'