Page MenuHomePhabricator
Paste P7281

python pwb.py upload -lang:ko -family:wikipedia -filename:"구글 어시스턴트 픽셀.png" -summary:"[[Special:Permalink/21608595#2018-06-09 Rusted Mine의 요청|위키백과:파일 업로드 요청#2018-06-09 Rusted Mine의 요청]]" ~/Downloads/pixel.png
ActivePublic

Authored by revi on Jun 21 2018, 10:44 PM.
$ python pwb.py upload -lang:ko -family:wikipedia -filename:"구글 어시스턴트 픽셀.png" -summary:"[[Special:Permalink/21608595#2018-06-09 Rusted Mine의 요청|위키백과:파일 업로드 요청#2018-06-09 Rusted Mine의 요청]]" ~/Downloads/pixel.png
Traceback (most recent call last):
File "pwb.py", line 251, in <module>
if not main():
File "pwb.py", line 244, in main
run_python_file(filename, [filename] + args, argvu, file_package)
File "pwb.py", line 115, in run_python_file
main_mod.__dict__)
File "./scripts/upload.py", line 207, in <module>
main()
File "./scripts/upload.py", line 202, in main
summary=summary)
File "/PATH/TO/pywikibot/tools/__init__.py", line 1423, in wrapper
return obj(*__args, **__kw)
File "/PATH/TO/pywikibot/specialbots.py", line 120, in __init__
self.targetSite.login()
File "/PATH/TO/pywikibot/site.py", line 2089, in login
user=self._username[sysop])
File "/PATH/TO/pywikibot/tools/__init__.py", line 1423, in wrapper
return obj(*__args, **__kw)
File "/PATH/TO/pywikibot-prod/pywikibot/login.py", line 122, in __init__
'wiki_code': self.site.code})
pywikibot.exceptions.NoUsername: ERROR: Username for commons:commons is undefined.
If you have an account for that site, please add a line to user-config.py:
usernames['commons']['commons'] = 'myUsername'
<class 'pywikibot.exceptions.NoUsername'>
CRITICAL: Closing network session.
$