Page MenuHomePhabricator

EventStreams first message never found
Closed, ResolvedPublic

Description

This is similar to T184713, but every time I listen to an EventStream the first entry or two is always "WARNING: Empty message found.".

import pywikibot
from pywikibot.comms.eventstreams import site_rc_listener
site = pywikibot.Site(user="TheSandBot")
rc = site_rc_listener(site)
    for change in rc:

        if (
            change['type'] == 'log' and
            change['namespace'] == 6 and
            change['log_type'] == 'upload'
        ):
            print(change['title'])

Will produce, as the first entry prior to actual/real entries:

WARNING: Empty message found.

This is on python 3.8.

Any advice would be greatly appreciated. I cannot use rc.data nor change.data (like other task) as I get AttributeError: 'EventStreams' object has no attribute 'data'

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript

I cannot use rc.data nor change.data (like other task) as I get AttributeError: 'EventStreams' object has no attribute 'data'

change is a dict, it does not have any Attributes; rc is an EventStreams instance it also does not have a data attribute.

Xqt triaged this task as Low priority.Feb 8 2020, 9:51 AM

Change 570989 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [IMPR] ignore first empty warning of EventStreams

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

Change 570989 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] ignore first empty warning of EventStreams

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