From 20b4db90f4a1b9a53865ffb66f73ffdac173111a Mon Sep 17 00:00:00 2001 From: Hiromu Hota Date: Tue, 26 Aug 2025 14:07:16 -0700 Subject: [PATCH] Add chunk_size to iter_lines to be compat with requests --- httpx/_models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httpx/_models.py b/httpx/_models.py index 2cc86321a4..f7e756171b 100644 --- a/httpx/_models.py +++ b/httpx/_models.py @@ -923,10 +923,10 @@ def iter_text(self, chunk_size: int | None = None) -> typing.Iterator[str]: for chunk in chunker.flush(): yield chunk - def iter_lines(self) -> typing.Iterator[str]: + def iter_lines(self, chunk_size: int | None = None) -> typing.Iterator[str]: decoder = LineDecoder() with request_context(request=self._request): - for text in self.iter_text(): + for text in self.iter_text(chunk_size=chunk_size): for line in decoder.decode(text): yield line for line in decoder.flush():