https://bugzilla.wikimedia.org/show_bug.cgi?id=69342
Bug ID: 69342 Summary: Wild card '*' for lang in user_config does not allow login Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: login.py Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: mpaa.wiki@gmail.com Web browser: --- Mobile Platform: ---
With this settings in user_config.py: usernames['wikipedia']['*'] = u'Mpaa' cannot login, while it can with: usernames['wikipedia']['en'] = u'Mpaa'
The try clause in login.py fails because self.site.code is 'en' and not '*'. KeyError is raised (BTW it should be except KeyError ....)
try: self.username = config.usernames[ self.site.family.name][self.site.code] except: raise NoUsername(u"""\ ERROR: Username for %(fam_name)s:%(wiki_code)s is undefined. If you have an account for that site, please add a line to user-config.py:
usernames['%(fam_name)s']['%(wiki_code)s'] = 'myUsername'""" % {'fam_name': self.site.family.name, 'wiki_code': self.site.code})