Closed charlesmadere closed 3 years ago
Here is a string that caused the exception to be thrown:
2021-10-21T05:46:31.5128275Z
And another one:
2021-10-21T01:24:49.5940343Z
This is due to Twitch not actually sticking to a set date format for everything, some return up to the seconds and some into milliseconds. We have already discussed this in the discord, which I recommend you join, and are looking to address it soon.
Thanks. This issue keeps popping up so I will take a look at it in the morning.
this issue appears to be completely fixed as of release v2.1.0
Sometimes, when constructing a new
PubSubChannelPointsMessage
instance, this line will cause an exception to be thrown:It seems that the
Z
character doesn't always end up being a part of the string, and as such, thestrptime
call fails.I wrote a really stupid fix for this, that seems to work for me:
Change the
self.timestamp
line withinPubSubChannelPointsMessage
's__init__
to this:Then add this method somewhere within
ext/pubsub/models.py
:Interestingly, within
PubSubBitsBadgeMessage
's__init__
, there is anotherstriptime
call that looks identical to the one inPubSubChannelPointsMessage
. This use however does not seem to have raised any exceptions for me. But regardless, I still use my aboveparseDate()
method with it and it seems to be fine.