ValvePython / dota2

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

Start error with the dota client #15

Closed Philaeux closed 7 years ago

Philaeux commented 7 years ago

Recently, i got this issue with a fresh build from the repo:

Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/gevent/greenlet.py", line 534, in run
    result = self._run(*self.args, **self.kwargs)
   File "/dazzar/bot/dota_bot.py", line 62, in start_dota
     self.dota.launch()
   File "/usr/local/lib/python3.4/dist-packages/dota2/client.py", line 245, in launch
     self.steam.games_played(self.steam.current_games_played + [self.app_id])
   File "/usr/local/lib/python3.4/dist-packages/steam/client/builtins/user.py", line 128, in games_played
     'games_played': map(lambda app_id: {'game_id': app_id}, app_ids)
   File "/usr/local/lib/python3.4/dist-packages/steam/client/__init__.py", line 257, in send
     proto_fill_from_dict(message.body, body_params)
   File "/usr/local/lib/python3.4/dist-packages/steam/util/__init__.py", line 99, in proto_fill_from_dict
     repr(key), type(val)
TypeError: Expected 'games_played' to be of type list, got <class 'map'>

I'm doint a simple client.connect(...) client.login(...) and dota.launch(...), every of each when the previous part fire ready.

rossengeorgiev commented 7 years ago

Oh I see. This is a bug in steam actually.

Philaeux commented 7 years ago

This is kind of strange, sometimes I get it (in my huge project), sometimes I don't (in a fresh test). But If you find a bug with my report, it is good xD

rossengeorgiev commented 7 years ago

It uses map which in python3 returns a iterable, and the proto message takes a list, Unless the message you are using has list, you won't encounter the bug. There might be other bugs like this lurking around, as most of the code was developed under python2.7

I will fix it and probably make a release later tonight.

Philaeux commented 7 years ago

Thanks man, I do use python3 indeed.