storage: _mount exception message may be bytes instead of str
In the development vagrant box, while FreedomBox was running, I ran the unit tests as root.
The first exception may be expected, but the second one is while trying to interpret the first error message.
INFO plinth.modules.storage.udisks2 New filesystem found: /dev/loop0p1
INFO plinth.modules.storage.udisks2 Auto-mounting device: /dev/loop0p1
INFO plinth.actions # storage..mount(…)
Exception in thread Thread-34 (_consider_for_mounting):
Traceback (most recent call last):
File "/freedombox/plinth/modules/storage/udisks2.py", line 197, in _mount
privileged.mount(block_device.preferred_device, _log_error=False)
File "/freedombox/plinth/actions.py", line 57, in wrapper
return _run_privileged_method_as_process(module_name, action_name,
File "/freedombox/plinth/actions.py", line 116, in _run_privileged_method_as_process
return _wait_for_return(*wait_args)
File "/freedombox/plinth/actions.py", line 154, in _wait_for_return
raise exception
subprocess.CalledProcessError: Command '['udisksctl', 'mount', '--block-device', '/dev/loop0p1', '--no-user-interaction']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/freedombox/plinth/modules/storage/udisks2.py", line 294, in _consider_for_mounting
_mount(object_path)
File "/freedombox/plinth/modules/storage/udisks2.py", line 199, in _mount
parts = exception.args[2].split(':')
TypeError: a bytes-like object is required, not 'str'
INFO plinth.modules.storage.udisks2 New filesystem found: /dev/loop0p1
INFO plinth.modules.storage.udisks2 Ignoring auto-mount on already mounted device: /dev/loop0p1