TwitchIO
TwitchIO copied to clipboard
A weird _process_data error in console
Traceback (most recent call last):
File ".../python3.8/site-packages/twitchio/websocket.py", line 308, in _process_data
await partial_(parsed)
File ".../python3.8/site-packages/twitchio/websocket.py", line 427, in _usernotice
tags = dict(x.split("=") for x in rawData.split(";"))
ValueError: dictionary update sequence element #21 has length 3; 2 is required
I have no clue how or why this happened 🤔
Hello! Thanks for the issue. If this is a general help question, for a faster response consider joining the official Discord Server
Else if you have an issue with the library please wait for someone to help you here.
The cause of this is possibly due to an = in the message content of a subscription message or other USERNOTICE message.
Does this error break the asyncio event loop requiring a restart? Or it just skips that one packet and continues working properly?
It will continue running
Maybe x.split("=", maxsplit=1) will solve this? 🤔
We were waiting for the merge of the and refactoring of the IRC parser before addressing this. We will look further into it soon.
@Commaster tags = dict(x.split("=", 1) for x in rawData.split(";"))
will most likely work if you would like to test locally on 2.4.0
install direct from git
python -m pip install -U --force-reinstall git+https://github.com/TwitchIO/TwitchIO.git
Oh! I was wondering why 2.4.0 wasn't showing up in pypi. Thank you, I shall try! (Though I haven't seen this exact error in quite some time, mostly just #209)
@Commaster 2.4.0 is now available on pypi. We have updated the join_channels logic in this version, although not sure how #209 is relevant to this issue. Try updating to 2.4.0 then update line 444 in websockets.py to the above and test it over a few days / weeks
Revisiting this since I am going to be updating some websocket / parser things soon, I believe the user-type also needs to be amended here
tags = dict(x.split("=", 1) for x in rawData.split(";"))
tags["user-type"] = tags["user-type"].split(":tmi.twitch.tv")[0].strip()
@Commaster pushed to Master