From 60966145db9ca977c8cd81699190fe7d4fd0abb4 Mon Sep 17 00:00:00 2001 From: n1nj4sec Date: Thu, 23 Mar 2017 22:00:25 +0100 Subject: [PATCH] fix unicode errors in netstat --- pupy/modules/netstat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pupy/modules/netstat.py b/pupy/modules/netstat.py index 4a0bfea1..4cb8a9c9 100644 --- a/pupy/modules/netstat.py +++ b/pupy/modules/netstat.py @@ -69,10 +69,10 @@ class NetStatModule(PupyModule): 'LADDR': colorize(':'.join([str(x) for x in connection['laddr']]), color), 'RADDR': colorize(':'.join([str(x) for x in connection['raddr']]), color), 'PID': colorize(connection.get('pid', ''), color), - 'USER': colorize(connection.get('username', ''), color), + 'USER': colorize(connection.get('username', '').encode('utf8','replace'), color), 'EXE': colorize( connection.get( - 'exe', connection.get('name', '') + 'exe', connection.get('name', '').encode('utf8','replace') ), color) })