Page MenuHomePhabricator

script_wui hardcoded to use User:DrTrigon
Closed, ResolvedPublic

Description

scripts/script_wui.py fails with horrible backtrace if not configured.

$ python pwb.py scripts/script_wui.py
* Initialization of bot
** Redirecting Lua print in order to catch it
** Pre-loading all relevant page contents
Traceback (most recent call last):
  File "pwb.py", line 157, in <module>
    run_python_file(fn, argv, argvu)
  File "pwb.py", line 67, in run_python_file
    exec(compile(source, filename, "exec"), main_mod.__dict__)
  File "scripts/script_wui.py", line 292, in <module>
    main()
  File "scripts/script_wui.py", line 283, in main
    bot = ScriptWUIBot(site, chan, site.user() + "_WUI", "irc.wikimedia.org")
  File "scripts/script_wui.py", line 137, in __init__
    self.refs[item].get(force=True)   # load all page contents
  File "...pywikibot/__init__.py", line 432, in wrapper
    return method(*__args, **__kw)
  File "...pywikibot/__init__.py", line 432, in wrapper
    return method(*__args, **__kw)
  File "...pywikibot/page.py", line 315, in get
    self._getInternals(sysop)
  File "...pywikibot/page.py", line 339, in _getInternals
    self.site.loadrevisions(self, getText=True, sysop=sysop)
  File ".../pywikibot/site.py", line 2024, in loadrevisions
    raise NoPage(page)
pywikibot.exceptions.NoPage: Page [[en:User:DrTrigon/DrTrigonBot/script wui-shell.css]] doesn't exist.
<class 'pywikibot.exceptions.NoPage'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort

Version: core-(2.0)
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:31 AM
bzimport set Reference to bz68797.
bzimport added a subscriber: Unknown Object (????).
jayvdb created this task.Jul 29 2014, 10:10 AM
XZise updated the task description. (Show Details)Nov 30 2014, 6:33 PM
XZise set Security to None.
XZise removed a subscriber: Unknown Object (????).

The scope of this bug is: the username should be obtained from the logged in user, not hardcoded, and a nice error if the page doesnt exist.

This bug is not intended to cover making the script work correctly for anyone, which is not an easy task.

Sitic added a subscriber: Sitic.Feb 15 2015, 1:34 PM

Change 206790 had a related patch set uploaded (by Ladsgroup):
Use user-based configuration settings in script_wui.py

https://gerrit.wikimedia.org/r/206790

Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptOct 28 2016, 9:26 PM
Restricted Application added a subscriber: TerraCodes. · View Herald Transcript
Ladsgroup moved this task from Incoming to Later on the User-Ladsgroup board.Oct 30 2016, 2:09 AM
Xqt triaged this task as Low priority.Oct 30 2016, 11:41 AM
Aklapper added a subscriber: Aklapper.

I will mentor this in Google-Code-In-2016

@DrTrigon: Could you please reply to the mentor registration email you received, and register? :) If you missed it, please drop me an email. Thanks!

Imported as https://codein.withgoogle.com/tasks/6219155388760064/

@Aklapper: Since @DrTrigon hasn't answered yet, I'm okay with being the mentor.

I registered as requested what did I miss?

@Aklapper: I am fine with you mentoring - as you wish - you can still ask me or refer to me if you guys have questions. I can also mentor if you prefer that.

@Ladsgroup: Thanks! Published.

To anybody working on this: Note that a patch already exists in https://gerrit.wikimedia.org/r/#/c/206790/ but needs rework (see comments in Gerrit) and rebasing. See https://www.mediawiki.org/wiki/Gerrit/Tutorial#Amending_a_change_.28your_own_or_someone_else.27s.29

Change 206790 merged by jenkins-bot:
Use user-based configuration settings in script_wui.py

https://gerrit.wikimedia.org/r/206790

Ladsgroup closed this task as Resolved.Dec 16 2016, 7:58 PM