[issue21373] robotparser: Automatically call modified function in read()

Maxime Lorant report at bugs.python.org
Mon Apr 28 14:55:25 CEST 2014


New submission from Maxime Lorant:

For the moment, RobotFileParser (on both Python 2.x and 3.x) has a method modified, but it is never called in the class itself, hence the last_checked attribute is always at 0 if the user doesn't call modified() explicitly. 

I would suggest to add a call to modified() at the end of the read() method. It makes more sense to have a last_checked value (returns in mtime()) updated by the class itself. Especially when the doc says: "Returns the time the ``robots.txt`` file was last fetched.". Currently this sentence isn't true, since the value has to be updated by the user.

----------
components: Library (Lib)
files: robotparser.diff
keywords: patch
messages: 217370
nosy: mlorant, orsenthil
priority: normal
severity: normal
status: open
title: robotparser: Automatically call modified function in read()
type: enhancement
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file35073/robotparser.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21373>
_______________________________________


More information about the Python-bugs-list mailing list