This issue was converted from https://jira.toolserver.org/browse/PYWP-10.
Summary: Login needed for reading site, causing NoUsername exceptions
Issue type: Bug - A problem which impairs or prevents the functions of the product.
Priority: Blocker
Status: Open
Assignee: Merlijn van Deen <valhallasw@arctus.nl>
On Fri, 21 Jan 2011 22:18:49, Merlijn van Deen <valhallasw@arctus.nl> opened the following bug:
(pwbde)valhallasw@dorthonion:~/src/pwbde/pwb-
flat/branches/rewrite/scripts$ cat test.py from pywikibot import
Page, Site print Page(Site('de', 'wikipedia'), 'test').site
(pwbde)valhallasw@dorthonion:~/src/pwbde/pwb-
flat/branches/rewrite/scripts$ python test.py Traceback (most recent
call last): File "test.py", line 2, in <module> print
Page(Site('de', 'wikipedia'), 'test').site File
"/home/valhallasw/src/pwbde/pwb-
flat/branches/rewrite/pywikibot/page.py", line 94, in site
return self._link.site File "/home/valhallasw/src/pwbde/pwb-
flat/branches/rewrite/pywikibot/page.py", line 2358, in site
self.parse() File "/home/valhallasw/src/pwbde/pwb-
flat/branches/rewrite/pywikibot/page.py", line 2341, in parse if
self._site.case() == 'first-letter': File
"/home/valhallasw/src/pwbde/pwb-
flat/branches/rewrite/pywikibot/site.py", line 970, in case
return self.siteinfo['case'] File "/home/valhallasw/src/pwbde/pwb-
flat/branches/rewrite/pywikibot/site.py", line 964, in siteinfo
self._getsiteinfo() File "/home/valhallasw/src/pwbde/pwb-
flat/branches/rewrite/pywikibot/site.py", line 921, in _getsiteinfo
sidata = sirequest.submit() File "/home/valhallasw/src/pwbde/pwb-
flat/branches/rewrite/pywikibot/data/api.py", line 219, in submit
self.site.login(False) File "/home/valhallasw/src/pwbde/pwb-
flat/branches/rewrite/pywikibot/site.py", line 703, in login
user=self._username[sysop]) File "/home/valhallasw/src/pwbde/pwb-
flat/branches/rewrite/pywikibot/__init.py", line 124, in wrapper
return method(*args, kw) File "/home/valhallasw/src/pwbde
/pwb-flat/branches/rewrite/pywikibot/init.py", line 124, in
wrapper return method(*args, kw) File
"/home/valhallasw/src/pwbde/pwb-
flat/branches/rewrite/pywikibot/login.py", line 105, in init__
'wiki_code': self.site.code}) pywikibot.exceptions.NoUsername:
ERROR: Username for wikipedia:de is undefined. If you have an
account for that site, please add a line to user-config.py:
usernames['wikipedia']['de'] = 'myUsername'
Version: core-(2.0)
Severity: blocker