-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: issubclass() arg 1 must be a class #183
Comments
I'm getting the exactly same error. Any fix for this ? OS: Win 11 |
I need debug...or code...or anything... |
This one might be occurring in Windows only, as I'm also using it. |
It might happen with any example code on this platform, I was using the client just to print the comments, while testing |
This happened to me too. Windows. With Example codes. |
Even exemples codes trigger this error, it might be due to some gifts I think... but not sure. If i'm starting this on a Live Stream with 1-2 people that doens't have activity it doesn't throw this error, but if i start it on a stream with a higher amount of people into the Live Stream it throws very quickly. And also along that error is one more that is quickly throwed and randomly: Traceback (most recent call last): Process finished with exit code 1 |
someone give me some code i can reproduce this with please |
And also the API :
|
I commented out: |
Python code: |
With how much stuff was added to proto in this latest update, I wouldn't be surprised if there's data types returned by tiktok that are being improperly handled from the webcast response. The following code will crash within seconds if you insert a unique id of a live user that has a lot of events being passed:
|
The interim solution is there should be a proper error handler that doesn't crash the client LOL...then we can fix this specific proto error |
You should probably add exception handling that captures the payload so it's easier to find which ones the schema fails to parse properly at the very least. |
Unfortunately I will internally combust it if I have to add another thing onto my plate right now. Waaaay too stressed for this. PRs welcome or I'll get to it when I have a sec. |
Any update on this error ? :< |
Yes, I am embarassed. This was a stupid issue. The internal Type I created "MessageType" shadowed a TikTok proto field also called "MessageType". This caused an instance of the TypeVar to be passed to an Release: https://github.com/isaackogan/TikTokLive/releases/tag/v6.0.1-post1 Will close this in 2 days if the issue is resolved. |
Thank you for the fix. I'm running it now, it looks like it was fixed and it does work. I'll keep an eye on it and if theres any other bug i'll report it. Also check the error with "AttributeError: 'GiftEvent' object has no attribute 'streakable'"
|
Way ahead of you.
|
Found another one after 13 minutes of running it
|
|
My dumb-ass self named it |
Did the stream stop perhaps? This error suggests the connection was closed by TikTok "suddenly". |
Nope the stream was still active, watching it. |
Welp, sorry to say I have put in all the time I have today. I will float this by the folks at TikTokLiveJava and see if they've seen this...that's all I can do. Reading up on it, what you are describing seems like a client issue, not a TikTokLive issue. |
I'm going to close this as resolved. Please open another issue @Unchangeable if you continue to face your separate issue, so I can fix it. |
Traceback (most recent call last):
File "...\test.py", line 24, in
client.run()
File "...\test.py", line 21, in run
return self._client.run()
^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\TikTokLive\client\client.py", line 170, in run
return self._asyncio_loop.run_until_complete(self.connect(**kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "...\Lib\site-packages\TikTokLive\client\client.py", line 155, in connect
await task
File "...\Lib\site-packages\TikTokLive\client\client.py", line 203, in _client_loop
async for event in self._ws_loop(initial_response):
File "...\Lib\site-packages\TikTokLive\client\client.py", line 240, in _ws_loop
for event in self.parse_webcast_response(response_message):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\TikTokLive\client\client.py", line 322, in parse_webcast_response
proto_event: ProtoEvent = event_type().parse(response.payload)
^^^^^^^^^^^^
File "", line 16, in init
File "...\Lib\site-packages\betterproto_init.py", line 631, in post_init
for field_name, meta in self.betterproto.meta_by_field_name.items():
^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\betterproto_init.py", line 698, in getattribute
value = super().getattribute(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\betterproto_init.py", line 754, in betterproto
meta = ProtoClassMetadata(self.class)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\betterproto_init.py", line 568, in init
self.default_gen = self.get_default_gen(cls, fields)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\betterproto_init.py", line 575, in _get_default_gen
return {field.name: cls.get_field_default_gen(field) for field in fields}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\betterproto_init.py", line 575, in
return {field.name: cls.get_field_default_gen(field) for field in fields}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\betterproto_init.py", line 910, in _get_field_default_gen
elif issubclass(t, Enum):
^^^^^^^^^^^^^^^^^^^
TypeError: issubclass() arg 1 must be a class
The text was updated successfully, but these errors were encountered: