Page MenuHomePhabricator

using pwb.py wrapper with global args before the script adds the script name to the scripts args list
Closed, ResolvedPublicBUG REPORT

Description

e.g. py -3 pwb.py -lang -family -simulate basics -foo -bar -baz gives ['basics', '-foo', '-bar', '-baz'] as arguments for basic.py whereas
py -3 pwb.py basics -foo -bar -baz gives ['-foo', '-bar', '-baz'] as expected.

Event Timeline

Xqt triaged this task as Medium priority.Jun 4 2020, 8:22 AM

Change 602298 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Use the scripts args executing the script

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

Xqt changed the subtype of this task from "Task" to "Bug Report".Jun 4 2020, 9:24 AM
Xqt raised the priority of this task from Medium to High.Nov 27 2021, 2:39 PM
Xqt added a project: Pywikibot-tests.

This also leads tests to fail if a global argument is passed to pwb wrapper
https://ci.appveyor.com/project/Ladsgroup/pywikibot-g4xqx/builds/41684969/job/tjwde82anclo8n7v

Change 742216 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [tests] Test whether pywikibot.argvu is not contaminated by global args

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

Change 742216 merged by jenkins-bot:

[pywikibot/core@master] [tests] Test whether pywikibot.argvu is not contaminated by global args

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

Change 602298 merged by jenkins-bot:

[pywikibot/core@master] [bugfix] Use the scripts args executing a script with pwb.py

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