Skip to content

Commit

Permalink
fix: TypeError: a bytes-like object is required
Browse files Browse the repository at this point in the history
I'm getting TypeError: a bytes-like object is required, not 'str' for that part of the code. `if capability.encode('utf-8') in result:`
or `if capability in result.decode('utf-8'):` could be better choices.
  • Loading branch information
come2darkside committed Jan 21, 2024
1 parent 1df513d commit 5c48995
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gtfonow/gtfonow.py
Expand Up @@ -3669,7 +3669,7 @@ def check_capability(binary_path, capability):
try:
result, error = execute_command(["getcap", binary_path])

if capability in result:
if capability in result.decode('utf-8'):
return True
return False

Expand Down

0 comments on commit 5c48995

Please sign in to comment.