Page MenuHomePhabricator

Archivebot changes parameter order between Python 2 and 3
Closed, ResolvedPublic


Steps to reproduce

  1. Archive page with Python 2
  2. Archive the same page with Python 3

Expected behavior
Archivebot standardizes the template on every run. Parameter order should be the same in Python 2 and 3, but unfortunately isn't.

Current behavior
If you archive once with Python 2 and once with Python 3, the parameter order is changed on every run. This is a problem when multiple bots archive on one wiki.


Related Gerrit Patches:

Event Timeline

Dvorapa created this task.Jan 15 2019, 10:40 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptJan 15 2019, 10:40 AM
Dvorapa triaged this task as Medium priority.Jan 15 2019, 10:40 AM
Xqt added a subscriber: Xqt.Jan 15 2019, 10:49 AM

@Dvorapa: Do you have a sample to inspect?

self.attributes is a dict and the sorting order is not deterministic

Probably either an OrderedDict could help or sorting the keys before returning the list:

def saveables(self):
    """Return a list of saveable attributes."""
    return [a for a in sorted(self.attributes) if self.attributes[a][1]
            and a != 'maxage']
Dvorapa claimed this task.Jan 15 2019, 11:21 AM

Change 484406 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[pywikibot/core@master] [bugfix] Fix parameter order different between Python 2 and 3

Change 484406 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Fix parameter order different between Python 2 and 3

Xqt closed this task as Resolved.Jan 31 2019, 6:38 PM