Page.botMayEdit() should return False if the page contains {{nobots|allow=Foo}} unless "Foo" matches the bot's username. But it will always return True in this situation.
The bug is in the following code snippet in page/__init__.py:
for template, params in templates: title = template.title(with_ns=False) if restrictions: if title in restrictions: return False if title == 'Nobots': if not params: return False else: bots = [bot.strip() for bot in params[0].split(',')] ### BUG if 'all' in bots or pywikibot.calledModuleName() in bots \ or username in bots: return False
On the line tagged with ### BUG, the value of bots in the example given will be the string "allow=Foo"; this should then be split on the '=' to get the actual list of allowed bots. Because it is not split, the if statement on the next line always matches when the "allow" parameter is present. After splitting the arguments, the method should use logic similar to that in the next section (under elif title == 'Bots':) to parse the parameters and return the appropriate value.