HorlogeSkynet / archey4

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

[BUG] critical error on macOS today #139

Closed kndol closed 11 months ago

kndol commented 11 months ago

Describe the bug Traceback (most recent call last): File "/usr/local/bin/archey", line 8, in sys.exit(main()) ^^^^^^ File "/usr/local/Cellar/archey4/4.14.2.0/libexec/lib/python3.12/site-packages/archey/main.py", line 185, in main for entry_instance in mapper(_entry_instantiator, available_entries): File "/usr/local/Cellar/python@3.12/3.12.0/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 619, in result_iterator yield _result_or_cancel(fs.pop()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/python@3.12/3.12.0/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 317, in _result_or_cancel return fut.result(timeout) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/python@3.12/3.12.0/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 449, in result return self.get_result() ^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/python@3.12/3.12.0/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 401, in get_result raise self._exception File "/usr/local/Cellar/python@3.12/3.12.0/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/archey4/4.14.2.0/libexec/lib/python3.12/site-packages/archey/main.py", line 159, in _entry_instantiator return Entries[entry.pop("type")].value( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/archey4/4.14.2.0/libexec/lib/python3.12/site-packages/archey/entries/disk.py", line 20, in init self._disk_dict = self._get_df_output_dict() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/archey4/4.14.2.0/libexec/lib/python3.12/site-packages/archey/entries/disk.py", line 175, in _get_df_output_dict df_output = run( ^^^^ File "/usr/local/Cellar/python@3.12/3.12.0/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 550, in run stdout, stderr = process.communicate(input, timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/python@3.12/3.12.0/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 1196, in communicate stdout = self.stdout.read() ^^^^^^^^^^^^^^^^^^ File "", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 1139: invalid start byte

Environment

Today I suddenly got this error.

HorlogeSkynet commented 11 months ago

Hello, could you attach here the output of LANG=C df -P -k ? Do you have any external drive currently connected ? 🙂

kndol commented 11 months ago

Filesystem 1024-blocks Used Available Capacity Mounted on /dev/disk1s2s1 976797816 9588148 29831932 25% / devfs 205 205 0 100% /dev /dev/disk1s3 976797816 2148496 29831932 7% /System/Volumes/Preboot /dev/disk1s5 976797816 24 29831932 1% /System/Volumes/VM /dev/disk1s6 976797816 16708 29831932 1% /System/Volumes/Update /dev/disk1s1 976797816 933822656 29831932 97% /System/Volumes/Data map auto_home 0 0 0 100% /System/Volumes/Data/home com.apple.TimeMachine.2023-10-27-213650.local@/dev/disk1s1 976797816 911264492 29831932 97% /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/?????????? MacBook�Pro 16"/2023-10-27-213650/Macintosh HD - ?????? com.apple.TimeMachine.2023-10-27-182111.local@/dev/disk1s1 976797816 908373184 29831932 97% /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/?????????? MacBook�Pro 16"/2023-10-27-182111/Macintosh HD - ?????? /dev/disk5s1 8718336 7887792 803712 91% /Library/Developer/CoreSimulator/Volumes/iOS_21A328 /dev/disk7s1 16721920 16196960 481864 98% /Library/Developer/CoreSimulator/Volumes/iOS_21A342 /dev/disk2s2 3906682672 2789712872 1116969800 72% /Volumes/External /dev/disk3s2 2929930672 2843197032 86733640 98% /Volumes/Time Machine com.apple.TimeMachine.2023-10-27-230230.local@/dev/disk1s1 976797816 912667300 29831932 97% /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/?????????? MacBook�Pro 16"/2023-10-27-230230/Macintosh HD - ?????? com.apple.TimeMachine.2023-10-17-235621.local@/dev/disk1s1 976797816 873322368 29831932 97% /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/?????????? MacBook�Pro 16"/2023-10-17-235621/Macintosh HD - ?????? com.apple.TimeMachine.2023-10-27-223709.local@/dev/disk1s1 976797816 911598632 29831932 97% /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/?????????? MacBook�Pro 16"/2023-10-27-223709/Macintosh HD - ??????

Yes, external drives are connected.

HorlogeSkynet commented 11 months ago

So it looks like your Time Machine's backup volume paths contain somehow Unicode characters (recent system upgrade ? Or hostname change ?).

If you can edit project sources, or are able to Git clone it, could you try modifying disk.py to add encoding="utf-8" to subprocess.run call ?

kndol commented 11 months ago

I upgraded system to 14.0 recentely. And your answer is the solution for this problem.

HorlogeSkynet commented 11 months ago

Thanks for your feedback, I'll try to patch this ASAP 🙏