Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an async blob upload fails while its input generator is suspended,
AsyncClient.create_blob()can return the exception while the local upload file is still open. This also occurs on task or AnyIO cancel-scope cancellation.Make the awaited upload own the file and close it in
finally. Shield only the close operation so cancellation cannot interrupt cleanup; the original failure or cancellation still propagates.Three regressions use a real temporary file and a synthetic HTTPX transport:
WriteError, actual asyncio task cancellation, and AnyIO cancel-scope cancellation. All three fail against the current implementation and pass with the fix. A successful 65,537-byte upload also retains the correct payload, digest and closed file handles.Validation on Python 3.12/macOS:
123 tests passed; lint and formatting passed. No model or Ollama server is needed. The broader Python/OS matrix, including Python 3.8 runtime compatibility, remains for CI.
Prepared with AI assistance and independently reviewed against the actual source and local runtime; no human pre-review is claimed.