From 04be6411c5629a126ab3c0b80c38f9ce59b7cadd Mon Sep 17 00:00:00 2001 From: Shubham gupta Ggps <24877361+gptshubham595@users.noreply.github.com> Date: Thu, 25 Jun 2020 02:35:02 +0530 Subject: [PATCH] TypeError: a bytes-like object is required, not 'str' SOLVE This solves this error : https://stackoverflow.com/questions/33054527/typeerror-a-bytes-like-object-is-required-not-str-when-writing-to-a-file-in --- cloudfrunt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudfrunt.py b/cloudfrunt.py index d172b94..b05381b 100644 --- a/cloudfrunt.py +++ b/cloudfrunt.py @@ -145,7 +145,7 @@ def find_cf_issues(domains): try: response = urlopen('http://' + domain) except HTTPError as e: - if e.code == 403 and 'Bad request' in e.fp.read(): + if e.code == 403 and b'Bad request' in e.fp.read(): try: response = urlopen('https://' + domain) except URLError as e: