Skip to content

Handle repo patch with non-UTF8 sequences#3918

Open
un-def wants to merge 1 commit into
masterfrom
issue_3880_fix_repo_non_utf8_patch
Open

Handle repo patch with non-UTF8 sequences#3918
un-def wants to merge 1 commit into
masterfrom
issue_3880_fix_repo_non_utf8_patch

Conversation

@un-def
Copy link
Copy Markdown
Collaborator

@un-def un-def commented May 29, 2026

Git text diff is not actually text in the usual sense -- it may contain any nonprintable bytes.

But since we send patches as files (multipart/form-data), not as JSON strings, we don't need to decode them at all.

In addition, the missing --binary flag was added.
Without this flag, modified binary files were effectively excluded from the patch with "Binary files a and b differ".

Fixes: #3880

Git text diff is not actually text in the usual sense -- it may contain
any nonprintable bytes.

But since we send patches as files (multipart/form-data), not
as JSON strings, we don't need to decode them at all.

In addition, the missing --binary flag was added.
Without this flag, modified binary files were effectively excluded
from the patch with "Binary files a and b differ".

Fixes: #3880
@un-def un-def requested a review from jvstme May 29, 2026 16:10
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.

[Bug]: dstack apply fails with UnicodeDecodeError when a modified tracked file contains non-UTF-8 bytes

1 participant