schollii / pypubsub

A Python publish-subcribe library (moved here from SourceForge.net where I had it for many years)
189 stars 29 forks source link

KeyError with topics named "event" #53

Closed PureTryOut closed 3 years ago

PureTryOut commented 3 years ago

I'm currently failing to send any messages with the topic name of event.<something> (replacing <something> with some text). For example I'm trying to send event.track_playback_started but it fails and returns a KeyError. I can however send other messages like state.track_playback_started. Even a topic something like "myapplicationname_event" fails to send with the key error. Only if I remove "event" from it it succeeds.

Is "event" a reserved topic? I can't find anything about it in the documentation. The only reserved topic I can find is pub.ALL_TOPICS but obviously I'm not using that one.

PureTryOut commented 3 years ago

Hmm, even topics like "mopidy" fail, but "mopidyf" and "eventt" or "even" succeeds. What the hell is going on...

PureTryOut commented 3 years ago

Huh, never mind it seems the KeyError actually came from my listener function. I just didn't realize sending the message would fail because of it, that's a bit annoying to work with... Closing.