When using the sprites-py SDK, commands intermittently fail with
ExecError: 1 even when the command itself is trivial and should never
fail:
>>> self.sprite.command("echo", "test").output()
b'test\n'
>>> self.sprite.command("echo", "test").output()
*** sprites.exceptions.ExecError: 1
>>> self.sprite.command("echo", "test").output()
b'test\n'
>>> self.sprite.command("echo", "test").output()
b'test\n'
>>> self.sprite.command("echo", "test").output()
*** sprites.exceptions.ExecError: 1
This happens both in interactive debugging (ipdb) and normal program
execution
Tracing the Code Path
-
sprite.command("echo", "test") creates a Cmd object (sprite.py)
-
.output() calls _run_sync() which calls _run_async() (exec.py)
-
_run_async() delegates to run_ws_command() (websocket.py)