mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-29 04:04:03 +03:00
Manage unicode decode error on Windows OS
This commit is contained in:
parent
cb3b3de783
commit
7ce0383eae
@ -46,7 +46,12 @@ class glancesGrabFs:
|
||||
# Grab the stats using the PsUtil disk_partitions
|
||||
# If 'all'=False return physical devices only (e.g. hard disks, cd-rom drives, USB keys)
|
||||
# and ignore all others (e.g. memory partitions such as /dev/shm)
|
||||
fs_stat = psutil.disk_partitions(all=False)
|
||||
try:
|
||||
fs_stat = psutil.disk_partitions(all=False)
|
||||
except UnicodeDecodeError:
|
||||
return []
|
||||
|
||||
# Loop over fs
|
||||
for fs in range(len(fs_stat)):
|
||||
fs_current = {}
|
||||
fs_current['device_name'] = fs_stat[fs].device
|
||||
|
@ -57,7 +57,10 @@ class Plugin(GlancesPlugin):
|
||||
"""
|
||||
|
||||
# Grab network interface stat using the PsUtil net_io_counter method
|
||||
netiocounters = psutil.net_io_counters(pernic=True)
|
||||
try:
|
||||
netiocounters = psutil.net_io_counters(pernic=True)
|
||||
except UnicodeDecodeError:
|
||||
return []
|
||||
|
||||
# Previous network interface stats are stored in the network_old variable
|
||||
network = []
|
||||
|
Loading…
Reference in New Issue
Block a user