Page MenuHomePhabricator

API to use Warning system
Closed, DeclinedPublic


Currently the API module uses a custom warning system, and some parts of the codebase dont correctly handle multiple warnings:

The API should be migrated to using the Python core warning system

Version: core-(2.0)
Severity: normal
See Also:
T72970: use DeprecationWarning system



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:50 AM
bzimport set Reference to bz71738.
bzimport added a subscriber: Unknown Object (????).

This seems similar to T72970 which has been resolved with I95000736f3fc9ccb80fe32106fb6516abc62cdd6. But the rest of the API (all calls to pywikibot(.bot).warning) are still not going via warnings.warn.

Hmm. Changeset is about this. The outstanding problem is how to integrate the upload script warning management (905b276c7e0ec284872ab66c06b2fabdad397795)

Why are we replacing only warn() when we could also replace the log(), critical(), error() functions using the inbuilt logging module ?

Xqt triaged this task as High priority.May 28 2017, 11:56 AM
Xqt claimed this task.
Xqt subscribed.

The proposal is not really sufficient. The warning module is for avoidable issues and the client application should be modified to eliminate the warning whereas logging.warning should be used if there is nothing the client application can do about the situation, but the event should still be noted. The API warnings are out of our scope I guess

Xqt changed the task status from Resolved to Declined.Oct 4 2020, 12:10 PM

See comment above. Refer for further informations.