Page MenuHomePhabricator

PWB should continue to execute scripts after launching generate_user_config
Open, LowestPublic

Description

Steps to reproduce

  1. Clone latest commit from Gerrit following user manual, install pip dependencies
  2. Run python pwb.py login

Expected behavior
If running login.py for the first time, the user files and preferences are created and user is prompted for password and then is logged in.

Current behavior
You have to run python pwb.py login twice. First for creating user files and preferences, second to login for the first time.

Configuration
last commit of pwb core from Gerrit, Python v3.6.1; the bug is present in master branch at least since Jan 2016

Event Timeline

Dvorapa updated the task description. (Show Details)

I don't know if you are talking about this, but pywikibot checks if user-config.py exist before it starts. If it's not present, it'll run generate-user-config.py, and not the script for which it was called.
So the problem that you describe probably does not concernant only login.py.

I don't know if you are talking about this, but pywikibot checks if user-config.py exist before it starts. If it's not present, it'll run generate-user-config.py, and not the script for which it was called.
So the problem that you describe probably does not concernant only login.py.

Yes, that's it, I haven't known this is a behavior of all scripts, but it haven't seemed logical to me in the case of login.py.

Xqt triaged this task as Lowest priority.May 28 2017, 10:59 AM
Framawiki renamed this task from login.py doesn't actually login for the first time to PWB should continue to execute scripts after launching generate_user_config.Nov 2 2017, 10:35 PM

In pwb.py a comment says, after having launched generate_user_config:

  1. because we have loaded pywikibot without user-config.py loaded, we need to re-start
  2. the entire process. Ask the user to do so.

Is it steel true ? I can't figure out what user configuration is loaded before this snippet.

Perhaps it could be loaded right after it was created? Or perhaps the original command should be stored and run after using subprocess.run() or something similar neutral?