# Buggy code
def msg_curse(self, args=None):
    """Return the dict to display in the curse interface."""
    # Init the return message
    ret = []

    # Only process if stats exist and display plugin enable...
    if not self.stats or args.disable_sensors:
        return ret

    # Build the string message
    # Header
    msg = "{0:18}".format("SENSORS")
    ret.append(self.curse_add_line(msg, "TITLE"))

    for i in self.stats:
        if i["value"] != b"ERR":
            # New line
            ret.append(self.curse_new_line())
            # Alias for the lable name ?
            label = self.has_alias(i["label"].lower())
            if label is None:
                label = i["label"]
            if i["type"] != "fan_speed":
                msg = "{0:15}".format(label[:15])
            else:
                msg = "{0:13}".format(label[:13])
            ret.append(self.curse_add_line(msg))
            if args.fahrenheit and i["type"] != "battery" and i["type"] != "fan_speed":
                value = to_fahrenheit(i["value"])
                unit = "F"
            else:
                value = i["value"]
                unit = i["unit"]
            try:
                msg = "{0:>7.0f}{1}".format(value, unit)
                ret.append(
                    self.curse_add_line(
                        msg,
                        self.get_views(
                            item=i[self.get_key()], key="value", option="decoration"
                        ),
                    )
                )
            except (TypeError, ValueError):
                pass

    return ret


# Traceback (ValueError)
roger@MEGIDO:~$ glances -V
Glances v2.6.1 with psutil v4.1.0
roger@MEGIDO:~$ glances
Traceback (most recent call last):
File "/usr/local/bin/glances", line 9, in <module>
load_entry_point('Glances==2.6.1', 'console_scripts', 'glances')()
File "/usr/local/lib/python2.7/dist-packages/glances/__init__.py", line 130, in main
args=core.get_args())
File "/usr/local/lib/python2.7/dist-packages/glances/standalone.py", line 67, in __init__
self.stats.update()
File "/usr/local/lib/python2.7/dist-packages/glances/stats.py", line 154, in update
self._plugins[p].update()
File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_hddtemp.py", line 62, in update
self.stats = self.glancesgrabhddtemp.get()
File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_hddtemp.py", line 145, in get
self.__update__()
File "/usr/local/lib/python2.7/dist-packages/glances/plugins/glances_hddtemp.py", line 122, in __update__
hddtemp_current['value'] = float(temperature) if temperature != b'ERR' else temperature
ValueError: could not convert string to float: SLP
roger@MEGIDO:~$

# Fixed code
def msg_curse(self, args=None):
    """Return the dict to display in the curse interface."""
    # Init the return message
    ret = []

    # Only process if stats exist and display plugin enable...
    if not self.stats or args.disable_sensors:
        return ret

    # Build the string message
    # Header
    msg = "{0:18}".format("SENSORS")
    ret.append(self.curse_add_line(msg, "TITLE"))

    for i in self.stats:
        # New line
        ret.append(self.curse_new_line())
        # Alias for the lable name ?
        label = self.has_alias(i["label"].lower())
        if label is None:
            label = i["label"]
        if i["type"] != "fan_speed":
            msg = "{0:15}".format(label[:15])
        else:
            msg = "{0:13}".format(label[:13])
        ret.append(self.curse_add_line(msg))
        # Temperature could be 'ERR' or 'SLP' (see issue#824)
        if i["value"] in (b"ERR", b"SLP"):
            msg = "{0:>8}".format(i["value"])
            ret.append(
                self.curse_add_line(
                    msg,
                    self.get_views(
                        item=i[self.get_key()], key="value", option="decoration"
                    ),
                )
            )
        else:
            if args.fahrenheit and i["type"] != "battery" and i["type"] != "fan_speed":
                value = to_fahrenheit(i["value"])
                unit = "F"
            else:
                value = i["value"]
                unit = i["unit"]
            try:
                msg = "{0:>7.0f}{1}".format(value, unit)
                ret.append(
                    self.curse_add_line(
                        msg,
                        self.get_views(
                            item=i[self.get_key()], key="value", option="decoration"
                        ),
                    )
                )
            except (TypeError, ValueError):
                pass

    return ret