Page MenuHomePhabricator

Refactor protocol assignment after json_warning
Closed, ResolvedPublicBUG REPORT

Description

After a json_warning in api.Requests, the protocol assignment switches the scheme in _http_request due to T326046. In some cases this results in HTTP 403 responses (again with json_warning), because the selected scheme is incorrect. The bot then keeps using the wrong scheme until a Timeout exception occurs.

The html message contains this:

Wikimedia Error
Error
Insecure request forbidden, use HTTPS instead. For details see https://lists.wikimedia.org/hyperkitty/list/mediawiki-api-announce@lists.wikimedia.org/message/VKQJRS36NXLIMHOWBOXJPUH35KETQCG5/.

Event Timeline

Xqt renamed this task from Refactor protocol assignmet after json_warning to Refactor protocol assignment after json_warning.Jan 12 2026, 5:51 PM
Xqt triaged this task as High priority.
Xqt changed the subtype of this task from "Task" to "Bug Report".

Change #1225635 had a related patch set uploaded (by Akaza24; author: Akaza24):

[pywikibot/core@master] Fix protocol assignment after json_warning

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

Change #1225635 abandoned by Akaza24:

[pywikibot/core@master] Fix protocol assignment after json_warning

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

Change #1225635 restored by Xqt:

[pywikibot/core@master] Fix protocol assignment after json_warning

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

Change #1225635 merged by jenkins-bot:

[pywikibot/core@master] Remove protocol swapping in api.Request

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

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

[pywikibot/core@master] doc: Update documentation for api.Request

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

Change #1228280 merged by jenkins-bot:

[pywikibot/core@master] doc: Update documentation for api.Request

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