Skip to content

fix: improve SSE line-ending normalization and incremental decoding - #37

Merged
oscatcher merged 2 commits into
mainfrom
fern-bot/2026-04-30T13-03Z
May 1, 2026
Merged

oscatcher merged 2 commits into
mainfrom
fern-bot/2026-04-30T13-03Z

Conversation

@fern-api

@fern-api fern-api Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

2.1.0 → 2.1.1

Refactor the SSE event source to use Python's incremental codec decoder
for correct multi-byte character handling across chunk boundaries, and
add proper normalization of CR, LF, and CRLF line endings per the SSE
specification. Also narrows the urllib3 dependency to >=2.6.3.

Key changes:

  • Add _normalize_sse_line_endings() to handle \r\n, bare \r, and \n uniformly
  • Replace one-shot chunk decoding with codecs.getincrementaldecoder in both iter_sse and aiter_sse
  • Flush incremental decoder at end of stream to avoid dropped trailing bytes
  • Narrow urllib3 version constraint from >=1.26.19,<2.0.0 || >=2.2.2,<3.0.0 to >=2.6.3,<3.0.0

🌿 Generated with Fern

fern-api Bot and others added 2 commits April 30, 2026 13:03
Refactor the SSE event source to use Python's incremental codec decoder
for correct multi-byte character handling across chunk boundaries, and
add proper normalization of CR, LF, and CRLF line endings per the SSE
specification. Also narrows the urllib3 dependency to >=2.6.3.

Key changes:
- Add `_normalize_sse_line_endings()` to handle \r\n, bare \r, and \n uniformly
- Replace one-shot chunk decoding with `codecs.getincrementaldecoder` in both `iter_sse` and `aiter_sse`
- Flush incremental decoder at end of stream to avoid dropped trailing bytes
- Narrow urllib3 version constraint from `>=1.26.19,<2.0.0 || >=2.2.2,<3.0.0` to `>=2.6.3,<3.0.0`

🌿 Generated with Fern

@oscatcher oscatcher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@oscatcher
oscatcher merged commit 54475d8 into main May 1, 2026
6 checks passed
@oscatcher
oscatcher deleted the fern-bot/2026-04-30T13-03Z branch May 1, 2026 15:28
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