Message334982
RobotFileParser.crawl_delay and RobotFileParser.request_rate raise AttributeError for a robots.txt with no matching entry for the given user-agent, including no default entry, rather than returning None which would be correct according to the documentation. E.g.:
>>> from urllib.robotparser import RobotFileParser
>>> parser = RobotFileParser()
>>> parser.parse([])
>>> parser.crawl_delay('example')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/urllib/robotparser.py", line 182, in crawl_delay
return self.default_entry.delay
AttributeError: 'NoneType' object has no attribute 'delay' |
|
Date |
User |
Action |
Args |
2019-02-06 20:33:07 | joseph_myers | set | recipients:
+ joseph_myers |
2019-02-06 20:33:03 | joseph_myers | set | messageid: <1549485183.59.0.634497522614.issue35922@roundup.psfhosted.org> |
2019-02-06 20:33:03 | joseph_myers | link | issue35922 messages |
2019-02-06 20:33:03 | joseph_myers | create | |
|