From 5c48995010ba14a265d03f65a35bd2ccd77a4b88 Mon Sep 17 00:00:00 2001 From: come2arkside <69916703+come2darkside@users.noreply.github.com> Date: Sun, 21 Jan 2024 21:07:43 +0300 Subject: [PATCH] fix: TypeError: a bytes-like object is required 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. --- gtfonow/gtfonow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfonow/gtfonow.py b/gtfonow/gtfonow.py index d579dd2..b07709d 100644 --- a/gtfonow/gtfonow.py +++ b/gtfonow/gtfonow.py @@ -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