jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/820865 )
Change subject: [bugfix] raise MalformedConfigError if 'maxarchivesize' is 0 ......................................................................
[bugfix] raise MalformedConfigError if 'maxarchivesize' is 0
maxarchivesize of 0 B, 0 K, 0 M or 0 T is invalid. Skip processing such a page.
Bug: T313886 Change-Id: I36db0d27ab2cf1d34e33f76d4f1ce464f386249f --- M scripts/archivebot.py 1 file changed, 6 insertions(+), 1 deletion(-)
Approvals: Matěj Suchánek: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/archivebot.py b/scripts/archivebot.py index 8b3100d..1adf780 100755 --- a/scripts/archivebot.py +++ b/scripts/archivebot.py @@ -627,7 +627,12 @@
def analyze_page(self) -> Set[ShouldArchive]: """Analyze DiscussionPage.""" - max_arch_size = str2size(self.get_attr('maxarchivesize')) + max_size = self.get_attr('maxarchivesize') + max_arch_size = str2size(max_size) + if not max_arch_size[0]: + raise MalformedConfigError('invalid maxarchivesize {!r}' + .format(max_size)) + counter = int(self.get_attr('counter', '1')) pattern = self.get_attr('archive')
pywikibot-commits@lists.wikimedia.org