Steps to replicate the issue (include links if applicable):
import pywikibot
s = pywikibot.Site('comprehensibleinputwiki:en')
s.login(user='unknown user 47110815')or
s = pywikibot.Site('comprehensibleinputwiki:en', user='unknown user 47110815')
s.login()What happens?:
WARNING: No user is logged in on site comprehensibleinputwiki:en
Traceback (most recent call last):
File "<pyshell#95>", line 1, in <module>
s.login(user='unknown user 47110815') # or s.login()
File "D:\pwb\GIT\core\pywikibot\site\_apisite.py", line 417, in login
if login_manager.login(retry=True, autocreate=autocreate):
File "D:\pwb\GIT\core\pywikibot\login.py", line 282, in login
self.check_user_exists()
File "D:\pwb\GIT\core\pywikibot\login.py", line 136, in check_user_exists
user = next(data)
File "<frozen _collections_abc>", line 330, in __next__
File "D:\pwb\GIT\core\pywikibot\tools\collections.py", line 275, in send
return next(self._started_gen)
StopIterationThis occurres if the given name is behind the last account name.
What should have happened instead?:
The warning should be as follows:
WARNING: No user is logged in on site wikipedia:de
Traceback (most recent call last):
File "<pyshell#99>", line 1, in <module>
s.login(user='unknown user 47110815')
File "D:\pwb\GIT\core\pywikibot\site\_apisite.py", line 417, in login
if login_manager.login(retry=True, autocreate=autocreate):
File "D:\pwb\GIT\core\pywikibot\login.py", line 282, in login
self.check_user_exists()
File "D:\pwb\GIT\core\pywikibot\login.py", line 146, in check_user_exists
raise NoUsernameError("Username '{}' does not exist on {}"
pywikibot.exceptions.NoUsernameError: Username 'Unknown user 47110815' does not exist on wikipedia:deSoftware version:
Pywikibot 7.0.0 (and earlier but cannot be tested due to syntax changes of Python 3.11