Page MenuHomePhabricator

API to use Warning system
Open, HighPublic

Description

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

http://git.wikimedia.org/blob/pywikibot%2Fcore.git/9ca1b85c367b381947426c2615f4ab246e497518/pywikibot%2Fsite.py#L4167

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

https://docs.python.org/2/library/warnings.html#warnings.warn


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

Details

Reference
bz71738

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 (????).
jayvdb created this task.Oct 7 2014, 7:25 AM
XZise added a subscriber: XZise.Feb 5 2015, 5:07 PM

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 https://gerrit.wikimedia.org/r/#/c/168574 is about this. The outstanding problem is how to integrate the upload script warning management (905b276c7e0ec284872ab66c06b2fabdad397795)

AbdealiJK added a subscriber: AbdealiJK.EditedMar 14 2016, 1:22 PM

Why are we replacing only warn() when we could also replace the log(), critical(), error() functions using the inbuilt logging module ?
https://docs.python.org/2/library/logging.html

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 14 2016, 1:22 PM
Xqt triaged this task as High priority.May 28 2017, 11:56 AM