You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
robots.txt rules are ignored when the file starts with a UTF-8 byte order mark #2350
When a robots.txt file starts with a UTF-8 byte order mark (BOM), RobotsTxtFile.load ignores the rules of the first group. is_allowed returns True for paths the file disallows, so a crawler with respect_robots_txt_file=True crawls them.
RobotsTxtFile.load decodes the body with body.decode('utf-8'), which keeps the BOM as \ufeff. Protego then reads the first line as \ufeffUser-agent: *, which is not a User-agent directive, and drops the group. Files saved by some Windows editors start with a BOM, and Google's robots.txt parser skips it.
Activity