This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvx
Recipients gvx
Date 2017-09-01.15:15:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504278922.84.0.0240979311873.issue31325@psf.upfronthosting.co.za>
In-reply-to
Content
> Finally, urllib/robotparser.py appears to contain a bug in the
> following:
>
>   req_rate = collections.namedtuple('req_rate',
>                                    'requests seconds')
>   entry.req_rate = req_rate
>   entry.req_rate.requests = int(numbers[0])
>   entry.req_rate.seconds = int(numbers[1])
> 
> As I read it, this should fail as the req_rate is immutable.

Ref: https://news.ycombinator.com/item?id=15136961

They are mistaken in the nature of the bug, which is that req_rate is
a namedtuple type, rather than an instance. As such, it is actually
mutable, causing the assignments to not fail. Every entry creates a
separate req_rate type, so it all works, but not in the way it should.
History
Date User Action Args
2017-09-01 15:15:22gvxsetrecipients: + gvx
2017-09-01 15:15:22gvxsetmessageid: <1504278922.84.0.0240979311873.issue31325@psf.upfronthosting.co.za>
2017-09-01 15:15:22gvxlinkissue31325 messages
2017-09-01 15:15:22gvxcreate