Caja File Manager crashes with odd and long file names

As much as I love using Mate, and above all Ubuntu Mate, I cannot use it on a production cenario due to the Caja file manager.

My setup: I have an old USB drive formated with HFS+ and I wanted to copy files from it. But I cannot copy the files when directories with odd characters, like colons and semi-colons (like /etc/etc/2008/13:08:2008/).

When I try to use Caja to copy the files, it crashes in a bad way. As the drive is journaled, I cannot change the name of the directory, and then copy.

When I resort to bash and do a "cp" to copy the files, everything works. Using other desktop enviroment, I can also copy the files. So, the problem is with Caja.

If anyone could help it would be great, as Mate is a great enviroment, but I feel these bugs are holding it back.

Tested with UM20.04, caja 1.24.0

touch this_long_file13:08, using caja copied to another dir, no error

A semicolon is not allowed in a filename as it indicates another command to follow, eg. ls ; df

Could you tell us more about the crash? Specifically, I'd like to know what exactly "in a bad way" means -- does the file manager go black for a few seconds and then disappear, for example? Are there any errors which appear briefly before the actual crash? Does a "Sorry, [something] has encountered an error" message appear? If so, could you show us what it says?

Yes. The problem might not be related to the ":" character in the directory name (I tried to reproduce it, the copy failed, but Caja sent a warning to the user and everything went kept working).

The problem appears when I right-click on the mouse and try to view the "Properties" of the file. When I try to do that on the a HFS+ drive that was used with a macbook (and that is mounted as read-only), the system crashes.

I do not know how to properly do a Traceback, but when I type *sudo caja" that is the verbose I get on the terminal:

Traceback (most recent call last):
  File "/usr/share/caja-python/extensions/dejadup.py", line 156, in get_file_items
    include_paths = self.dejadup.get_dejadup_paths('include-list')
  File "/usr/share/caja-python/extensions/dejadup.py", line 70, in get_dejadup_paths
    paths = ast.literal_eval([stdout][0]) # Convert shell dump to list
  File "/usr/lib/python3.8/ast.py", line 99, in literal_eval
    return _convert(node_or_string)
  File "/usr/lib/python3.8/ast.py", line 98, in _convert
    return _convert_signed_num(node)
  File "/usr/lib/python3.8/ast.py", line 75, in _convert_signed_num
    return _convert_num(node)
  File "/usr/lib/python3.8/ast.py", line 66, in _convert_num
    _raise_malformed_node(node)
  File "/usr/lib/python3.8/ast.py", line 63, in _raise_malformed_node
    raise ValueError(f'malformed node or string: {node!r}')
ValueError: malformed node or string: b"['$HOME']\n"
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted

Yikes! So the whole system crashes when you try to find the properties of a file?

That's bizarre! Please show us your .xsession-errors (it should be in your home directory -- it's a hidden file, so ensure you have hidden files displayed).

As for the error messages you attached above -- it just means that Deja Dup (the backup tool) got confused when you ran Caja as root. I think that's an unrelated problem.

I hope this helps:

This message is very frequent in my .xsession-errors file:

Traceback (most recent call last):
File "/usr/share/caja-python/extensions/dejadup.py", line 156, in get_file_items
include_paths = self.dejadup.get_dejadup_paths('include-list')
File "/usr/share/caja-python/extensions/dejadup.py", line 70, in get_dejadup_paths
paths = ast.literal_eval([stdout][0]) # Convert shell dump to list
File "/usr/lib/python3.8/ast.py", line 99, in literal_eval
return _convert(node_or_string)
File "/usr/lib/python3.8/ast.py", line 98, in _convert
return _convert_signed_num(node)
File "/usr/lib/python3.8/ast.py", line 75, in _convert_signed_num
return _convert_num(node)
File "/usr/lib/python3.8/ast.py", line 66, in _convert_num
_raise_malformed_node(node)
File "/usr/lib/python3.8/ast.py", line 63, in _raise_malformed_node
raise ValueError(f'malformed node or string: {node!r}')
ValueError: malformed node or string: b"['$HOME']\n"

And in the end of the file you can find these two lines:
RuntimeError: object at 0x7f41c5c22f40 of type RenameMenu is not initialized
RuntimeError: object at 0x7f41c59c79c0 of type FolderColorMenu is not initialized

To reproduce the error:

  1. Get an USB hard disk formated with HFS
  2. Attach to the computer
  3. Right click on a directory (preferably one with lots of subdirectories) and try to see the properties

I generaly use Ubuntu Linux inside a VM (Virtualbox) on top of Windows, but I believe I also had this problem when using Ubuntu Linux when dual booting.

So Caja only crashes when there are strange characters in file names? So if you create a file or folder on that same volume which doesn't have any weird characters in the name, then find the file's properties, that won't crash Caja?

I'll see if I can replicate this myself. I see that @pavlos_kairis was unable to replicate it, but I'll check it out just in case.

Is it possible for you to re-insert this volume into a Mac and do a disk check on the volume?