Page MenuHomePhabricator

logentries.LogEntry(): site is default site
Closed, ResolvedPublic

Description

Just a random move log entry from de wikipedia:

$ python pwb.py shell -family:wikipedia -lang:en

Welcome to the Pywikibot interactive shell!
>>> import pywikibot
>>> s = pywikibot.Site("de")
>>> s
Site("de", "wikipedia")
>>> pg = pywikibot.Page(s, u"Fußballnationalmannschaft von Montserrat")
>>> for log in s.logevents(logtype="move", page=pg, total=1): print log.new_title().site
... 
wikipedia:en

"wikipedia:de" is the expected instead of "wikipedia:en" in the last line.

Details

Event Timeline

zhuyifei1999 raised the priority of this task from to Needs Triage.
zhuyifei1999 updated the task description. (Show Details)
zhuyifei1999 changed Security from none to None.
zhuyifei1999 subscribed.

Hmm it should fail everytime as MoveEntry.new_title does not supply a Site. All entries should use the default pywikibot.Site() object.

Okay testing it for myself it does only output that one entry (I thought the ... meant that you had cut previous entries).

For whatever reason this is not notified here, but I've uploaded a patch regarding this: https://gerrit.wikimedia.org/r/175414/

Change 175414 merged by jenkins-bot:
[FIX] Logentries: Use the query's site argument

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

Seem fixed. Original input gives "wikipedia:de" as output.