Another try for issue#1185

pull/1223/head
nicolargo 2017-11-16 21:12:14 +01:00
parent 6260f193cd
commit d367cc012b
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ if PY3:
def b(s):
if isinstance(s, binary_type):
return s
return s.encode('latin-1')
return s.encode('utf-8')
def nativestr(s):
if isinstance(s, text_type):

View File

@ -21,7 +21,7 @@
import operator
from glances.compat import u
from glances.compat import b
from glances.logger import logger
from glances.plugins.glances_plugin import GlancesPlugin
@ -195,7 +195,7 @@ class Plugin(GlancesPlugin):
if len(hotspotname) > ifname_max_width:
hotspotname = '_' + hotspotname[-ifname_max_width + 1:]
# Add the new hotspot to the message
msg = '{:{width}}'.format(u(hotspotname),
msg = '{:{width}}'.format(b(hotspotname),
width=ifname_max_width)
ret.append(self.curse_add_line(msg))
msg = '{:>7}'.format(i['signal'], width=ifname_max_width)