Commit e105d53c authored by Brenden Blanco's avatar Brenden Blanco Committed by GitHub

Merge pull request #942 from r4f4/fix-filetop

filetop: Fix TypeError by not mixing bytes and str.
parents 9da5a972 29392650
...@@ -185,14 +185,14 @@ while 1: ...@@ -185,14 +185,14 @@ while 1:
line = 0 line = 0
for k, v in reversed(sorted(counts.items(), for k, v in reversed(sorted(counts.items(),
key=lambda counts: counts[1].rbytes)): key=lambda counts: counts[1].rbytes)):
name = k.name name = k.name.decode()
if k.name_len > DNAME_INLINE_LEN: if k.name_len > DNAME_INLINE_LEN:
name = name[:-3] + "..." name = name[:-3] + "..."
# print line # print line
print("%-6d %-16s %-6d %-6d %-7d %-7d %1s %s" % (k.pid, k.comm, print("%-6d %-16s %-6d %-6d %-7d %-7d %1s %s" % (k.pid,
v.reads, v.writes, v.rbytes / 1024, v.wbytes / 1024, k.type, k.comm.decode(), v.reads, v.writes, v.rbytes / 1024,
name)) v.wbytes / 1024, k.type.decode(), name))
line += 1 line += 1
if line >= maxrows: if line >= maxrows:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment