Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pidcat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S python -u
#!/usr/bin/env -S python3 -u

'''
Copyright 2009, The Android Open Source Project
Expand Down Expand Up @@ -304,7 +304,7 @@ def tag_in_tags_regex(tag, tags):
linebuf += colorize(' ' * (header_size - 1), bg=WHITE)
linebuf += ' PID: %s UID: %s GIDs: %s' % (line_pid, line_uid, line_gids)
linebuf += '\n'
print(linebuf)
print(bytes(linebuf, 'utf-8').decode('utf-8'))
last_tag = None # Ensure next log gets a tag printed

dead_pid, dead_pname = parse_death(tag, message)
Expand All @@ -314,7 +314,7 @@ def tag_in_tags_regex(tag, tags):
linebuf += colorize(' ' * (header_size - 1), bg=RED)
linebuf += ' Process %s (PID: %s) ended' % (dead_pname, dead_pid)
linebuf += '\n'
print(linebuf)
print(bytes(linebuf, 'utf-8').decode('utf-8'))
last_tag = None # Ensure next log gets a tag printed

# Make sure the backtrace is printed after a native crash
Expand Down Expand Up @@ -359,4 +359,4 @@ def tag_in_tags_regex(tag, tags):
message = matcher.sub(replace, message)

linebuf += indent_wrap(message)
print(linebuf.encode('utf-8'))
print(bytes(linebuf, 'utf-8').decode('utf-8'))