Skip to content

Commit

Permalink
Fix trace_fields Python3 encoding issue (iovisor#1745)
Browse files Browse the repository at this point in the history
This PR fixes the encoding issue in Python3 by converting the argument passed to `find` to a bytearray.
  • Loading branch information
javierhonduco authored and yonghong-song committed May 9, 2018
1 parent 799f46a commit a91c8c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/python/bcc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ def trace_fields(self, nonblocking=False):
# however, the illegal address will be printed out.
# Hence, both cases are handled here.
line = line[ts_end + 1:]
sym_end = line.find(":")
sym_end = line.find(b":")
msg = line[sym_end + 2:]
return (task, int(pid), int(cpu), flags, float(ts), msg)
except KeyboardInterrupt:
Expand Down

0 comments on commit a91c8c2

Please sign in to comment.