From 323173036664c78d679559afd73425833e78fab8 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Thu, 18 Jun 2020 19:27:06 +0100 Subject: [PATCH] Remove isinstance() from robotparser2.py Originally for encoding Python 2 Unicode strings [1]. Will not be used in Python 3 because the variables are strings, if they were bytes exceptions would be raised. [1] c97f68f7 ("accept unicode in robots.txt can_fetch", 2004-11-09) --- linkcheck/robotparser2.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/linkcheck/robotparser2.py b/linkcheck/robotparser2.py index d4ca6ee2..1a5af387 100644 --- a/linkcheck/robotparser2.py +++ b/linkcheck/robotparser2.py @@ -276,10 +276,6 @@ class RobotFileParser: useragent, url, ) - if not isinstance(useragent, str): - useragent = useragent.encode("ascii", "ignore") - if not isinstance(url, str): - url = url.encode("ascii", "ignore") if self.disallow_all: log.debug(LOG_CHECK, " ... disallow all.") return False