Page MenuHomePhabricator

Mark "-new" as deprecate key and remove it in future
Closed, ResolvedPublic

Description

Local key -new in this moment work as duplicate for pagegenerators option -newpages.
This complicates both the code and documentation, and creates difficulties for users trying to use this key, which is not available to other scripts. Accordingly, need to mark this key as deprecated in order to prepare bot owners for its further removal from "interwiki.py"

Event Timeline

Xqt triaged this task as Low priority.May 6 2026, 7:35 AM
Xqt updated the task description. (Show Details)
Xqt changed the task status from Open to In Progress.May 9 2026, 2:25 PM
Xqt claimed this task.

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

[pywikibot/core@master] interwiki: Replace -new option with pagegenerators -newpages

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

@Ivan-r: Are you able to review my patch?

@Ivan-r: Are you able to review my patch?

Can we colorize the Warning output?

WARNING: C:\Users\DragonMsi\Documents\pywikibot2\scripts\interwiki.py:2437: ArgumentDeprecationWarning: -new:30 is deprecated since release 11.3.0; use -newpages:30 instead.
  main()

Should main() be printed in such cases?

@Ivan-r: The warning system is used here, not the logging system. Colors are implemented for the logging system at Pywikibot but not for the warning system. And also the last line of the stack level is printed by default. To change the default warning would be a feature request and a new issue because it is too extensive to implement it.

Change #1285490 merged by jenkins-bot:

[pywikibot/core@master] interwiki: Replace -new option with pagegenerators -newpages

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

I see that in another case, there are no extra lines.

Logging in to mcw:pl as ProBot
WARNING: API error writeapidenied: You're not allowed to edit this wiki through the API.
ERROR: Login failed (writeapidenied).
Password for user ProBot on mcw:pl (no characters will be shown):

So it looks like an incorrect implementation of the warning in this particular case, and not normal behavior.