Page MenuHomePhabricator

archivebot failing when archive counter starts with zero (0)
Closed, ResolvedPublicBUG REPORT

Description

While trying to archive a page at en.wikiquote, with a counter parameter passed, archivebot instead archives on two pages:

  • Wikiquote:Administrators' noticeboard/Archive/1
  • Wikiquote:Administrators' noticeboard/Archive/34

However they should all go to Wikiquote:Administrators' noticeboard/Archive/034 and so on.

Details provided below:

Template code
{{User:MABot/config
 | algo = old(30d)
 | archive = Wikiquote:Administrators' noticeboard/Archive/%(counter)d
 | counter = 034
 | maxarchivesize = 500K
 | archiveheader =
}}
Terminal
$ pwb.py archivebot User:MABot/config -family:wikiquote -lang:en -simulate -v
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)]
Fetching template transclusions...
Found 1 wikiquote:en processes running, including this one.
Processing [[en:Wikiquote:Administrators' noticeboard]]
19 thread(s) found on [[en:Wikiquote:Administrators' noticeboard]]
Looking for: {{User:MABot/config}} in [[en:Wikiquote:Administrators' noticeboard]]
Processing 19 threads
Archiving 9 thread(s).
SIMULATION: edit action blocked.
Page [[Wikiquote:Administrators' noticeboard/Archive/1]] saved without any changes.
Page [[Wikiquote:Administrators' noticeboard/Archive/1]] saved
APISite("en", "wikiquote").login(False) called when a previous login was in progress.
SIMULATION: edit action blocked.
Page [[Wikiquote:Administrators' noticeboard/Archive/34]] saved without any changes.
Page [[Wikiquote:Administrators' noticeboard/Archive/34]] saved
SIMULATION: edit action blocked.
Page [[Wikiquote:Administrators' noticeboard]] saved without any changes.
Page [[Wikiquote:Administrators' noticeboard]] saved
Dropped throttle(s).
Closing network session.
Network session closed.

Version: pywikibot master (at 4662519f)

Event Timeline

MarcoAurelio changed the subtype of this task from "Task" to "Bug Report".Mar 18 2019, 9:21 PM
MarcoAurelio updated the task description. (Show Details)

Note that you may want to use correctly zero-padded counter %(counter)03d. Because

>>> str(int('034') + 1)
'35'

Note that you may want to use correctly zero-padded counter %(counter)03d. Because

>>> str(int('034') + 1)
'35'

That was helpful: https://en.wikiquote.org/?diff=2563235
It archived fine this time and no Archive 1 was even called/created.
Thank you!

However archivebot keeps removing the 0 from the counter parameter: https://en.wikiquote.org?diff=2563236
Would that be an issue? They want their archives to be preceded with 0.

That's expected, as I demonstrated in my comment. The counter is a number, its format %03d (base-10 integer, 3 characters, missing ones filled with zeros) is declared in the pattern.

Okay, should we close this as invalid/resolved?