Repository navigation
Done
Labels
bugSomething isn't working
Description
Please follow this template when reporting a bug in the Python SoCha Client. Providing as much detail as possible will help us to quickly understand and resolve the issue.
Description
Ich wollte den GameState kopieren, dafür wollte ich deepcopy aus copy benutzen.
Environment
- Python version: 3.12
- Operating System: Fedora 45
- Version of the Python SoCha Client: 5.1.0
Expected Behavior
Klonen des GameStates.
Actual Behavior
Fehler:
Traceback (most recent call last):
File "/home/sturmente/SoftwareChallenge/gho/test/gho-termin2.py", line 192, in <module>
Starter(logic=Logic())
File "/home/sturmente/SoftwareChallenge/gho/test/.venv/lib/python3.12/site-packages/socha/starter.py", line 116, in __init__
self.client.start()
File "/home/sturmente/SoftwareChallenge/gho/test/.venv/lib/python3.12/site-packages/socha/api/networking/game_client.py", line 294, in start
self._client_loop()
File "/home/sturmente/SoftwareChallenge/gho/test/.venv/lib/python3.12/site-packages/socha/api/networking/game_client.py", line 364, in _client_loop
self._on_object(response)
File "/home/sturmente/SoftwareChallenge/gho/test/.venv/lib/python3.12/site-packages/socha/api/networking/game_client.py", line 255, in _on_object
self._on_move_request(room_id)
File "/home/sturmente/SoftwareChallenge/gho/test/.venv/lib/python3.12/site-packages/socha/api/networking/game_client.py", line 274, in _on_move_request
move_response = self._game_handler.calculate_move()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sturmente/SoftwareChallenge/gho/test/gho-termin2.py", line 155, in calculate_move
our_move_options_before = get_team_move_options(initial_game_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sturmente/SoftwareChallenge/gho/test/gho-termin2.py", line 110, in get_team_move_options
game_state = deepcopy(game_state)
^^^^^^^^^^^^^^^^^^^^
File "/home/sturmente/.local/share/uv/python/cpython-3.12.15-linux-x86_64-gnu/lib/python3.12/copy.py", line 151, in deepcopy
rv = reductor(4)
^^^^^^^^^^^
TypeError: cannot pickle 'builtins.GameState' object
Reproduction Steps
Einen bestehenden GameState nehmen und in deepcopy übergeben.
Activity
SturmEnte commentedon Nov 28, 2026
Wahrscheinlich funktionierender Workaround:
Garantieren kann ich aber diesmal nichts.
SturmEnte commentedon Nov 28, 2026
Falls es bereits irgendeine einfache Möglichkeit gibt einen GameState zu klonen, habe ich das übersehen.
Gerne mitteilen.
YoEnte commentedon Nov 30, 2026
Sollte in rust möglich sein, war letztes Jahr auch, habe ich ggf vergessen zu übernehmen