Index: Lib/urllib/robotparser.py =================================================================== --- Lib/urllib/robotparser.py (revision 64891) +++ Lib/urllib/robotparser.py (working copy) @@ -60,7 +60,10 @@ elif err.code >= 400: self.allow_all = True else: - self.parse(f.read().splitlines()) + filetext = f.read() + if isinstance(filetext, bytes): + filetext = filetext.decode('utf-8') + self.parse(filetext.splitlines()) def _add_entry(self, entry): if "*" in entry.useragents: