Skip to content

assert while using an UCI program #1161

@folkertvanheusden

Description

@folkertvanheusden

Hi,

I often get this error when talking to a UCI program using python-chess:

Exception in callback Protocol._line_received()
handle: <Handle Protocol._line_received()>
Traceback (most recent call last):
  File "/usr/lib/python3.13/asyncio/events.py", line 89, in _run
    self._context.run(self._callback, *self._args)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/folkert/.local/lib/python3.13/site-packages/chess/engine.py", line 1040, in _line_received
    self.command._line_received(self, line)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/folkert/.local/lib/python3.13/site-packages/chess/engine.py", line 1289, in _line_received
    assert self.state in [CommandState.ACTIVE, CommandState.CANCELLING]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

What is causing it? Can I prevent it somehow?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugengineChess engine integration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions