Skip to content

Commit

Permalink
Encode values to utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
vfuse committed Jan 14, 2018
1 parent 9fae301 commit c8cb873
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nixstatsagent/nixstatsagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import urllib2


__version__ = '1.1.34'
__version__ = '1.1.35'

__FILEABSDIRNAME__ = os.path.dirname(os.path.abspath(__file__))

Expand Down
5 changes: 5 additions & 0 deletions nixstatsagent/plugins/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ def run(self, *unused):
'pid', 'name', 'ppid', 'exe', 'cmdline', 'username',
'cpu_percent', 'memory_percent', 'io_counters'
])
pinfo['name'].encode('utf-8')
pinfo['username'].encode('utf-8')
pinfo['cmdline'] = ''.join(pinfo['cmdline']).encode('utf-8')
except psutil.NoSuchProcess:
pass
except psutil.AccessDenied:
pass
else:
process.append(pinfo)
return process
Expand Down

0 comments on commit c8cb873

Please sign in to comment.