Page MenuHomePhabricator

Page.getOldVersion() does not update Page._revisions dict
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce:

import pywikibot
s = pywikibot.Site()
p = pywikibot.Page(s, 'Alan Smithee')
p.oldest_revision.revid
1
p.oldest_revision.text is None
True
p.getOldVersion(1)
'Alan Smithee ist eigentlich kein Regisseur, sondern ein Anagramm von "The Alias Man", was bedeutet, daß Filme, in denen Alan Smithee Regie geführt hat, dem eigentlichen Regisseur so peinlich waren, daß er seinen Namen nicht dafür aufs Spiel setzen wollte.\n\n'
p.oldest_revision.text is None
True
p._revisions
{1: Revision({'revid': 1, 'parentid': 0, 'user': 'bln2-t3-2.mcbone.net', 'anon': True, 'userid': 0, 'timestamp': Timestamp(2001, 5, 30, 11, 37, 26), 'size': 261, 'sha1': '185a1b30f0410e190c89a745f128109511610bea', 'roles': ['main'], 'slots': {'main': {'contentmodel': 'wikitext'}}, 'comment': '*', 'parsedcomment': '*', 'tags': [], 'minor': False, 'userhidden': False, 'commenthidden': False, 'text': None, 'contentmodel': 'wikitext'})}

What happens?:
p.oldest_revision.text is still None

What should have happened instead?:
p.oldest_revision.text should contain the text retrieved by getOldVersion()

Software version:
All Pywikibot releases (3.0 - 7.2)

Event Timeline

Xqt triaged this task as Medium priority.Mar 27 2022, 10:11 AM

Change 778675 had a related patch set uploaded (by Mpaa; author: Mpaa):

[pywikibot/core@master] [bugfix]: Do not delete text when updating a Revision

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

Xqt assigned this task to Mpaa.

Change 778675 merged by jenkins-bot:

[pywikibot/core@master] [bugfix]: Do not delete text when updating a Revision

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

Xqt removed a project: Patch-For-Review.