Skip to content

Avoid KeyError on unsuccessful _clear_uncommitted_blocks - #237

Open
ahurst-openai wants to merge 5 commits into
blobfile:masterfrom
ahurst-openai:ahurst/missing-etag
Open

ahurst-openai wants to merge 5 commits into
blobfile:masterfrom
ahurst-openai:ahurst/missing-etag

Conversation

@ahurst-openai

Copy link
Copy Markdown

Better handle the case where _clear_uncommitted_blocks returns with an unsuccessful HttpResponse.

Currently this will raise a KeyError because the etag header is missing.

…n-successful HttpResponse.

This will fail with a `KeyError` because the `etag` header is missing.
@ahurst-openai

ahurst-openai commented Apr 30, 2024 •

Copy link
Copy Markdown
Author

I preserved the apparent intention to silently tolerate an unsuccessful _clear_uncommitted_blocks. (This is what happens in the other case when None is returned.). If this should be rethought PLMK.

An alternative implementation would be to intercept the 4xx HTTP status code [from the last request] inside _clear_uncommitted_blocks and return None, such as is done in the other two cases.

@ahurst-openai ahurst-openai changed the title Tolerate unsuccessful _clear_uncommitted_blocks Avoid KeyError on unsuccessful _clear_uncommitted_blocks Apr 30, 2024
datetime.UTC
Alias for the UTC timezone singleton datetime.timezone.utc.
Added in version 3.11.

Fixed used datetime.timezone.utc directly.
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.

1 participant