HorlogeSkynet / archey4

:computer: Maintained fork of the original Archey (Linux) system tool
https://git.io/archey4
GNU General Public License v3.0
295 stars 37 forks source link

[BUG] archey4 can't handle filesystems with spaces #103

Closed josefschabasser closed 3 years ago

josefschabasser commented 3 years ago

Describe the bug archey4 does not support filesystems with spaces in their names. rclone (a tool to work with and mount cloud storage) allows to create filesystems with spaces in their names and archey4 fails to parse df's output. Furthermore, rclone always puts a : at the end of the filesystems name, maybe this helps in some way.

rclone configuration:

[OneDrive Business]
type = onedrive
...

df output:

Dateisystem                1K-Blöcke   Benutzt     Verfügbar Verw% Eingehängt auf
OneDrive Business:        1073741824   1511724    1072230100    1% /home/[USER]/rclone/OneDrive Business

archey4 output:

WARNING: [archey.entries.temperature] [lm-sensors]: ERROR: Can't get value of subfeature temp1_input: Can't read
Traceback (most recent call last):
  File "/usr/bin/archey", line 33, in <module>
    sys.exit(load_entry_point('archey4==4.13.1', 'console_scripts', 'archey')())
  File "/usr/lib/python3.9/site-packages/archey/__main__.py", line 168, in main
    for entry_instance in mapper(_entry_instantiator, available_entries):
  File "/usr/lib/python3.9/concurrent/futures/_base.py", line 608, in result_iterator
    yield fs.pop().result()
  File "/usr/lib/python3.9/concurrent/futures/_base.py", line 438, in result
    return self.__get_result()
  File "/usr/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
    raise self._exception
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.9/site-packages/archey/__main__.py", line 144, in _entry_instantiator
    return Entries[entry.pop('type')].value(
  File "/usr/lib/python3.9/site-packages/archey/entries/disk.py", line 18, in __init__
    self._disk_dict = self._get_df_output_dict()
  File "/usr/lib/python3.9/site-packages/archey/entries/disk.py", line 133, in _get_df_output_dict
    'total_blocks': int(columns[1])
ValueError: invalid literal for int() with base 10: 'Business:'

Expected behavior archey4 shouldn't fail. Maybe display local storage only and print a warning that some filesystems were ignored.

Screenshots Please see the error message above.

Environment

Additional context

josefschabasser commented 3 years ago

I see there's already a PR for this: https://github.com/HorlogeSkynet/archey4/pull/102

HorlogeSkynet commented 3 years ago

Hi Josef, thanks for opening this up. Indeed a PR is already on its way to fix this issue. You can expect a new release shipping this patch within the following days. Bye 👋

HorlogeSkynet commented 3 years ago

Released as v4.13.2 @josefschabasser. Bye :wave: