Last modified: 2014-07-23 14:14:26 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1390/ Reported by: valhallasw Created on: 2012-01-07 00:10:07 Subject: Wrong language with a one-site family can yield confusing er Original description: valhallasw@dorthonion:~/src/pywikipedia/trunk$ python version.py Pywikipedia \[http\] trunk/pywikipedia \(r9820, 2011/12/29, 12:08:55\) Python 2.6.5 \(r265:79063, Apr 16 2010, 13:09:56\) \[GCC 4.4.3\] config-settings: use\_api = True use\_api\_login = True unicode test: ok valhallasw@dorthonion:~/src/pywikipedia/trunk$ cat user-config.py mylang='de' site='botwiki' usernames\['botwiki'\]\['de'\] = u'valhallasw' valhallasw@dorthonion:~/src/pywikipedia/trunk$ python generate\_family\_file.py http://botwiki.sno.cc/wiki/Main\_Page botwiki Generating family file from http://botwiki.sno.cc/wiki/Main\_Page ================================== api url: http://botwiki.sno.cc/w/api.php MediaWiki version: 1.17.0 ================================== Determining other languages... Loading wikis... \* en... in cache Retrieving namespaces... en Writing families/botwiki\_family.py... families/botwiki\_family.py already exists. Overwrite? \(y/n\)y valhallasw@dorthonion:~/src/pywikipedia/trunk$ python login.py Traceback \(most recent call last\): File "login.py", line 436, in <module> main\(\) File "login.py", line 431, in main loginMan = LoginManager\(password, sysop = sysop, verbose=verbose\) File "login.py", line 106, in \_\_init\_\_ raise pywikibot.NoUsername\(u'ERROR: Username for %s:%s is undefined.\nIf you have an account for that site, please add such a line to user-config.py:\n\nusernames\[\'%s\'\]\[\'%s\'\] = \'myUsername\'' % \(self.site.family.name, self.site.lang, self.site.family.name, self.site.lang\)\) pywikibot.exceptions.NoUsername: ERROR: Username for botwiki:botwiki is undefined. If you have an account for that site, please add such a line to user-config.py: usernames\['botwiki'\]\['botwiki'\] = 'myUsername' however, the correct error message would be valhallasw@dorthonion:~/src/pywikipedia/trunk$ python login.py Traceback \(most recent call last\): File "login.py", line 436, in <module> main\(\) File "login.py", line 431, in main loginMan = LoginManager\(password, sysop = sysop, verbose=verbose\) File "login.py", line 106, in \_\_init\_\_ raise pywikibot.NoUsername\(u'ERROR: Username for %s:%s is undefined.\nIf you have an account for that site, please add such a line to user-config.py:\n\nusernames\[\'%s\'\]\[\'%s\'\] = \'myUsername\'' % \(self.site.family.name, self.site.lang, self.site.family.name, self.site.lang\)\) pywikibot.exceptions.NoUsername: ERROR: Username for botwiki:botwiki is undefined. If you have an account for that site, please add such a line to user-config.py: usernames\['botwiki'\]\['en'\] = 'myUsername'
*** This bug has been marked as a duplicate of bug 65044 ***