Page MenuHomePhabricator

APISite._simple_request conflicts with 'site' parameter of wbeditentity
Closed, ResolvedPublicBUG REPORT

Description

site = pywikibot.Site('en', 'wikipedia')
page = pywikibot.Page(site, 'Dummy non-existing page')
item = pywikibot.ItemPage.fromPage(page, lazy_load=True)
item.removeSitelink(page.site, asynchronous=True)

This fails with:
TypeError: create_simple() got multiple values for keyword argument 'site'

It's because the kwargs for APISite._simple_request contain

{
  "site": "enwiki",
  "title": "Dummy"
}

which conflict with the site argument to Request.create_simple call.

Event Timeline

Change 637846 had a related patch set uploaded (by Mpaa; owner: Mpaa):
[pywikibot/core@master] [bugfix] Avoid conflicts between site and possible site keyword

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

Xqt assigned this task to Mpaa.
Xqt triaged this task as High priority.

Change 637846 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Avoid conflicts between site and possible site keyword

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

Reopened. The patch gives a strange TypeError

Change 637853 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Fix create_simple in test environment

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

Change 637853 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Fix create_simple in test environment

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