Skip to content

Sprite.command unreliable #10

@akaihola

Description

@akaihola

I have this script, almost straight from the README:

import os

from sprites import SpritesClient

# Create a client
client = SpritesClient(token=os.environ["SPRITES_TOKEN"])

# Get a sprite handle
sprite = client.sprite("my-sprite")

# Use the Go-style API
cmd = sprite.command("ls", "-la")
output = cmd.output()
print(output.decode())

And I've installed dependencies:

$ uv pip install sprites-py
Resolved 8 packages in 8ms
Installed 8 packages in 10ms
 + anyio==4.12.1
 + certifi==2026.1.4
 + h11==0.16.0
 + httpcore==1.0.9
 + httpx==0.28.1
 + idna==3.11
 + sprites-py==0.0.1

This always works:

❯ sprite exec -s my-sprite hostname
my-sprite

But this only occasionally works:

$ python sprites_command.py
Traceback (most recent call last):
  File "sprites_command.py", line 13, in <module>
    output = cmd.output()
  File "sprites/exec.py", line 128, in output
    raise ExitError(code, self._stdout_data, self._stderr_data)
sprites.exceptions.ExecError: 1

$ python sprites_command.py
Traceback (most recent call last):
  File "sprites_command.py", line 13, in <module>
    output = cmd.output()
  File "sprites/exec.py", line 128, in output
    raise ExitError(code, self._stdout_data, self._stderr_data)
sprites.exceptions.ExecError: 1

$ python sprites_command.py
my-sprite

$ python sprites_command.py
my-sprite

$ python sprites_command.py
Traceback (most recent call last):
  File "sprites_command.py", line 13, in <module>
    output = cmd.output()
  File "sprites/exec.py", line 128, in output
    raise ExitError(code, self._stdout_data, self._stderr_data)
sprites.exceptions.ExecError: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions