Open laluka opened 8 months ago
same bug on :
Linux 1fac59b8f594 6.6.12-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jan 16 01:35:44 UTC 2024 x86_64 GNU/Linux
I met this problem when I use trash-list
to show my trashes.
trash-put IMG_0023.JPG
trash-list
The error:
Traceback (most recent call last):
File "/Users/renbaijun/.local/bin/trash-list", line 5, in <module>
sys.exit(main())
^^^^^^
File "/Users/renbaijun/.local/share/pipx/venvs/trash-cli/lib/python3.12/site-packages/trashcli/list/main.py", line 41, in main
).run(sys.argv)
^^^^^^^^^^^^^
File "/Users/renbaijun/.local/share/pipx/venvs/trash-cli/lib/python3.12/site-packages/trashcli/list/main.py", line 91, in run
action.run_action(args)
File "/Users/renbaijun/.local/share/pipx/venvs/trash-cli/lib/python3.12/site-packages/trashcli/list/list_trash_action.py", line 52, in run_action
for message in ListTrash(self.environ,
File "/Users/renbaijun/.local/share/pipx/venvs/trash-cli/lib/python3.12/site-packages/trashcli/list/list_trash_action.py", line 100, in list_all_trash
for msg in self._print_trashinfo(volume, trash_info,
File "/Users/renbaijun/.local/share/pipx/venvs/trash-cli/lib/python3.12/site-packages/trashcli/list/list_trash_action.py", line 120, in _print_trashinfo
contents = self.content_reader.contents_of(trashinfo_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/renbaijun/.local/share/pipx/venvs/trash-cli/lib/python3.12/site-packages/trashcli/fs.py", line 123, in contents_of
return _read_file(path)
^^^^^^^^^^^^^^^^
File "/Users/renbaijun/.local/share/pipx/venvs/trash-cli/lib/python3.12/site-packages/trashcli/fs.py", line 243, in _read_file
return f.read()
^^^^^^^^
File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 37: invalid start byte
trash-restore
also report the same error.
Describe the bug
Removing a file with specific utf 8 chars breaks trash-put (and probably others) ! :upside_down_face:
trash-cli version Output of: trash-put --version trash-put
0.17.1.14
up to0.23.11.10
Are you using the latest version of trash-cli? Yes
Have you tried if the bug is present in the latest version of trash-cli? Yes
Have done that? Then continue with the bug report.
Operating system:
Linux mothership 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
To Reproduce Copy and paste the commands (and their output) to execute in order to reproduce the behavior:
Expected behavior File/Dir being removed
Have a marvelous day, sorry for the crash :( :heart_decoration: