mirror of
https://github.com/Comfy-Org/comfy-python-sdk.git
synced 2026-11-04 23:37:47 +00:00
[PR #224] fix: infer remaining bytes for multipart uploads #224
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
effort:medium
effort:small
effort:small
effort:trivial
priority:nice-to-have
priority:nice-to-have
priority:recommended
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-python-sdk#224
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-python-sdk/pull/224
Author: @allenflux
Created: 10/18/2026
Status: 🔄 Open
Base:
main← Head:fix/multipart-file-position📝 Commits (1)
ee93cc6fix: infer remaining bytes for multipart uploads📊 Changes
4 files changed (+106 additions, -4 deletions)
View changed files
📝
CHANGELOG.md(+5 -0)📝
src/comfy_low/_multipart.py(+4 -4)📝
tests/test_low_decoding.py(+35 -0)➕
tests/test_multipart_upload.py(+62 -0)📄 Description
A binary file already read or seeked past its start fails in
ComfyLow.post_assetsandAsyncComfyLow.post_assetswhenfile_sizeis omitted: the multipart iterator sends from the current cursor, but the file-descriptor size probe declares the entire file length. For example, a ten-byte disk file read by four bytes raisesToo little data for declared Content-Length; an equivalentBytesIOsucceeds.Infer the remaining bytes using the stream’s logical
tell()position, preserving buffered-file cursor behavior. Clamp positions beyond EOF to zero and leave unseekable sizes unknown. Explicitfile_sizeand the upload iterator are unchanged. Regression tests use real local HTTP uploads in both transports and check the received file part, plus raw/buffered/memory streams, EOF, and unseekable pipe controls.Validation on Python 3.12.11/macOS:
No live gateway or Router calls were made. The Python 3.10–3.13 CI matrix remains to be run.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.