ValvePython / dota2

🐸 Python package for interacting with Dota 2 Game Coordinator
http://dota2.readthedocs.io
201 stars 32 forks source link

RecursionError in Dota2Client.channels.join_lobby_channel() #30

Closed LadaBr closed 6 years ago

LadaBr commented 7 years ago

When I use function dota.channels.join_lobby_channel() I get this error:

    @dota.on('lobby_new')
    def invite_players(lobby):
          dota.channels.join_lobby_channel()

File "/var/www/django/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_tblib.py", line 168, in init self.tb_next = Traceback(tb.tb_next) File "/var/www/django/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_tblib.py", line 168, in init self.tb_next = Traceback(tb.tb_next) File "/var/www/django/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_tblib.py", line 168, in init self.tb_next = Traceback(tb.tb_next) File "/var/www/django/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_tblib.py", line 168, in init self.tb_next = Traceback(tb.tb_next) File "/var/www/django/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_tblib.py", line 168, in init self.tb_next = Traceback(tb.tb_next) File "/var/www/django/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_tblib.py", line 168, in init self.tb_next = Traceback(tb.tb_next) File "/var/www/django/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_tblib.py", line 168, in init self.tb_next = Traceback(tb.tb_next) File "/var/www/django/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_tblib.py", line 168, in init self.tb_next = Traceback(tb.tb_next) File "/var/www/django/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_tblib.py", line 168, in init self.tb_next = Traceback(tb.tb_next) File "/var/www/django/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_tblib.py", line 162, in init self.tb_frame = Frame(tb.tb_frame) File "/var/www/django/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_tblib.py", line 154, in init for k, v in frame.f_globals.items() File "/var/www/django/dotaleague.cz/env/lib/python3.5/site-packages/gevent/_tblib.py", line 155, in if k in ("file", "name") RecursionError: maximum recursion depth exceeded in comparison Tue Apr 18 09:35:14 2017 <callback at 0x7f0c07f55f60 stopped> failed with RecursionError

I fixed it by using: dota.channels.join_channel("Lobby_%s" % lobby.lobby_id,channel_type=3)

rossengeorgiev commented 7 years ago

Hmmm. That shouldn't matter as your 'fix' code does exactly the same thing. It's probably something else. I'm not sure how your code is setup but the when using SteamClient it will gevent patch some bits of the standard library. So, for best result I would suggest that you do the patching first in your code. Should be the first thing, before any other imports. Here is the code:


import gevent.monkey
gevent.monkey.patch_socket()
gevent.monkey.patch_ssl()
rossengeorgiev commented 6 years ago

closing this due to inactivity