Skip to content

Commit fbbd909

Browse files
T-256T-256karpetrosyan
authored
Handle EndOfStream for anyio backend (#899)
* Handle `EndOfStream` for anyio backend * Update CHANGELOG.md Co-authored-by: Kar Petrosyan <92274156+karpetrosyan@users.noreply.github.com> --------- Co-authored-by: T-256 <Tester@test.com> Co-authored-by: Kar Petrosyan <92274156+karpetrosyan@users.noreply.github.com>
1 parent 10481ce commit fbbd909

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7+
## Unreleased
8+
9+
- Handle `EndOfStream` exception for anyio backend. (#899)
10+
711
## 1.0.4 (February 21st, 2024)
812

913
- Add `target` request extension. (#888)

httpcore/_backends/anyio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ async def read(
2727
TimeoutError: ReadTimeout,
2828
anyio.BrokenResourceError: ReadError,
2929
anyio.ClosedResourceError: ReadError,
30+
anyio.EndOfStream: ReadError,
3031
}
3132
with map_exceptions(exc_map):
3233
with anyio.fail_after(timeout):
@@ -62,6 +63,7 @@ async def start_tls(
6263
exc_map = {
6364
TimeoutError: ConnectTimeout,
6465
anyio.BrokenResourceError: ConnectError,
66+
anyio.EndOfStream: ConnectError,
6567
}
6668
with map_exceptions(exc_map):
6769
try:

0 commit comments

Comments
 (0)