From 65b7cc6ed1952f1bc0bc6853b2e46eb602a0c7c0 Mon Sep 17 00:00:00 2001 From: SuhrudhC <152193534+SuhrudhC@users.noreply.github.com> Date: Wed, 25 Nov 2026 21:42:26 -0500 Subject: [PATCH 1/2] Clarify empty data handling in passthrough documentation --- h11/_connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/h11/_connection.py b/h11/_connection.py index e37d82a..f6e3af2 100644 --- a/h11/_connection.py +++ b/h11/_connection.py @@ -546,7 +546,8 @@ def send_with_data_passthrough(self, event: Event) -> Optional[List[bytes]]: :meth:`send` returns a single :term:`bytes-like object`, this instead returns a list of them -- and when sending a :class:`Data` event, this list is guaranteed to contain the exact object you passed in as - :attr:`Data.data`. See :ref:`sendfile` for discussion. + :attr:`Data.data`, except that empty data may be omitted when using + chunked transfer encoding. See :ref:`sendfile` for discussion. """ if self.our_state is ERROR: From 164fd37f5c134843c2f6e90d34f569806d590781 Mon Sep 17 00:00:00 2001 From: SuhrudhC <152193534+SuhrudhC@users.noreply.github.com> Date: Wed, 25 Nov 2026 21:42:59 -0500 Subject: [PATCH 2/2] Add news fragment for passthrough documentation clarification --- newsfragments/217.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/217.doc.rst diff --git a/newsfragments/217.doc.rst b/newsfragments/217.doc.rst new file mode 100644 index 0000000..014786c --- /dev/null +++ b/newsfragments/217.doc.rst @@ -0,0 +1 @@ +Clarify that empty data may be omitted by send_with_data_passthrough when chunked transfer encoding is used.