Skip to content

fix: handle spaces in Python image COPY paths - #5088

Open
nkgotcode wants to merge 1 commit into
daytonaio:mainfrom
nkgotcode:fix/python-sdk-add-local-file-spaces
Open

fix: handle spaces in Python image COPY paths#5088
nkgotcode wants to merge 1 commit into
daytonaio:mainfrom
nkgotcode:fix/python-sdk-add-local-file-spaces

Conversation

@nkgotcode

@nkgotcode nkgotcode commented Jun 17, 2026

Copy link
Copy Markdown

Description

Handle Python SDK image COPY directives with local file or directory paths that contain spaces by emitting Dockerfile JSON-array syntax and parsing JSON-form COPY sources when reading a Dockerfile.

Fixes #2700

Documentation

  • No documentation update is required for this Python SDK bug fix.
  • No documentation changes were needed.

Related Issue(s)

This PR addresses issue #2700.

Screenshots

n/a

Notes

Validation:

PYTHONPATH="libs/sdk-python/src:libs/api-client-python:libs/api-client-python-async:libs/toolbox-api-client-python:libs/toolbox-api-client-python-async" libs/sdk-python/.venv/bin/pytest libs/sdk-python/tests/test_image.py::TestImageFromDockerfile libs/sdk-python/tests/test_image.py::TestImageAddLocal -q

Summary by cubic

Fix handling of Dockerfile COPY paths with spaces in the Python SDK by emitting JSON-array syntax and parsing JSON-form COPY directives when reading Dockerfiles. Fixes #2700.

  • Bug Fixes
    • Emit JSON-array args for COPY in add_local_file/add_local_dir to preserve spaces.
    • Parse JSON-form COPY with json.loads and validate string elements when loading a Dockerfile.
    • Add tests for JSON COPY parsing and paths with spaces.

Written for commit 7345a6c. Summary will update on new commits.

Review in cubic

Signed-off-by: Khanh Le <nkgotcode@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@vedranjukic
vedranjukic force-pushed the main branch 2 times, most recently from 2c15a7f to b40f732 Compare June 23, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add_local_file fails if file name has spaces

1 participant